Package net.shibboleth.idp.authn.impl
Class X500SubjectCanonicalization
java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
net.shibboleth.shared.component.AbstractIdentifiedInitializableComponent
net.shibboleth.shared.component.AbstractIdentifiableInitializableComponent
net.shibboleth.idp.authn.SubjectCanonicalizationFlowDescriptor
net.shibboleth.idp.authn.AbstractSubjectCanonicalizer
net.shibboleth.idp.authn.impl.X500SubjectCanonicalization
- All Implemented Interfaces:
Function<SubjectCanonicalizationContext,,String> Predicate<ProfileRequestContext>,SubjectCanonicalizer,FlowDescriptor,Component,DestructableComponent,IdentifiableComponent,IdentifiedComponent,InitializableComponent
A
SubjectCanonicalizer that transforms the input Subject
into a principal name by searching for one and only one X509Certificate public credential,
or in its absence one and only one X500Principal.
A list of OIDs is used to locate an RDN to extract from the Subject DN and use as the principal name after applying the transforms from the base class.
Alternatively, a list of subjectAltName extension types may be specified, which takes precedence over the subject, if a match is found.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected StringdoApply(SubjectCanonicalizationContext c14nContext) Performs c14n if possible.protected StringFind an RDN with the specified OID.private X509CertificategetCertificate(SubjectCanonicalizationContext c14nContext) Helper method that returns the first and onlyX509Certificate, returning null otherwise.private X500PrincipalgetX500Principal(SubjectCanonicalizationContext c14nContext) Helper method that returns the first and onlyX500Principal, returning null otherwise.voidsetObjectIds(List<String> ids) Set the OIDs to search for, in order of preference.voidsetSubjectAltNameTypes(List<Integer> types) Set the subjectAltName types to search for, in order of preference.Methods inherited from class net.shibboleth.idp.authn.AbstractSubjectCanonicalizer
apply, applyTransforms, doInitialize, getLogPrefix, setLowercase, setTransforms, setTrim, setUppercaseMethods inherited from class net.shibboleth.idp.authn.SubjectCanonicalizationFlowDescriptor
equals, getFlowId, hashCode, setActivationCondition, setFlowId, test, toStringMethods inherited from class net.shibboleth.shared.component.AbstractIdentifiableInitializableComponent
setIdMethods inherited from class net.shibboleth.shared.component.AbstractIdentifiedInitializableComponent
ensureId, getId, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentExceptionMethods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent
checkComponentActive, checkSetterPreconditions, destroy, doDestroy, initialize, isDestroyed, isInitializedMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.shibboleth.shared.component.DestructableComponent
destroy, isDestroyedMethods inherited from interface net.shibboleth.shared.component.IdentifiableComponent
setIdMethods inherited from interface net.shibboleth.shared.component.IdentifiedComponent
getIdMethods inherited from interface net.shibboleth.shared.component.InitializableComponent
initialize, isInitialized
-
Field Details
-
CN_OID
Common Name (CN) OID.- See Also:
-
log
@Nonnull private final org.slf4j.Logger logClass logger. -
subjectAltNameTypes
subjectAltName types to search for. -
objectIds
OIDs to search for.
-
-
Constructor Details
-
X500SubjectCanonicalization
public X500SubjectCanonicalization()Constructor.
-
-
Method Details
-
setSubjectAltNameTypes
Set the subjectAltName types to search for, in order of preference.- Parameters:
types- types to search for
-
setObjectIds
Set the OIDs to search for, in order of preference.- Parameters:
ids- RDN OIDs to search for
-
doApply
Performs c14n if possible.- Specified by:
doApplyin classAbstractSubjectCanonicalizer- Parameters:
c14nContext- the current subject canonicalization context- Returns:
- event indicating result of function
-
findRDN
@Nullable protected String findRDN(@Nonnull org.cryptacular.x509.dn.RDNSequence sequence, @Nonnull @NotEmpty String oid) Find an RDN with the specified OID.- Parameters:
sequence- the DN componentsoid- the OID to look for- Returns:
- the first matching RDN value, or null
-
getX500Principal
@Nullable private X500Principal getX500Principal(@Nonnull SubjectCanonicalizationContext c14nContext) Helper method that returns the first and onlyX500Principal, returning null otherwise.- Parameters:
c14nContext- input context- Returns:
- the only matching principal or null
-
getCertificate
@Nullable private X509Certificate getCertificate(@Nonnull SubjectCanonicalizationContext c14nContext) Helper method that returns the first and onlyX509Certificate, returning null otherwise.- Parameters:
c14nContext- input context- Returns:
- the only certificate or null
-