Class SealedPrincipalSerializer<T extends Principal>
java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
net.shibboleth.idp.authn.principal.AbstractPrincipalSerializer<String>
net.shibboleth.idp.authn.principal.SimplePrincipalSerializer<T>
net.shibboleth.idp.authn.principal.SealedPrincipalSerializer<T>
- Type Parameters:
T- principal type
- All Implemented Interfaces:
PrincipalSerializer<String>,Component,DestructableComponent,InitializableComponent
Principal serializer that encrypts/decrypts the data when serializing.
- Since:
- 4.1.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final org.slf4j.LoggerClass logger.private static final StringField name of password.private DataSealerData sealer. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected StringReturn the appropriate value to create thePrincipalaround based on the serialized form.protected StringReturn the appropriate value to serialize from the input object.voidsetDataSealer(DataSealer theSealer) Set theDataSealerto use.booleanWhether the supplied value can be deserialized.booleanWhether the supplied principal can be serialized.Methods inherited from class net.shibboleth.idp.authn.principal.SimplePrincipalSerializer
deserialize, serializeMethods inherited from class net.shibboleth.idp.authn.principal.AbstractPrincipalSerializer
getJsonGenerator, getJsonReaderMethods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent
checkComponentActive, checkSetterPreconditions, destroy, doDestroy, doInitialize, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentException, initialize, isDestroyed, isInitializedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.shibboleth.shared.component.InitializableComponent
initialize, isInitialized
-
Field Details
-
PASSWORD_FIELD
Field name of password.- See Also:
-
log
@Nonnull private final org.slf4j.Logger logClass logger. -
sealer
Data sealer.
-
-
Constructor Details
-
SealedPrincipalSerializer
public SealedPrincipalSerializer(@Nonnull @ParameterName(name="claz") Class<T> claz, @Nonnull @NotEmpty @ParameterName(name="name") String name) throws NoSuchMethodException, SecurityException Constructor.- Parameters:
claz- principal typename- field name of JSON structure- Throws:
SecurityException- if the constructor cannot be accessedNoSuchMethodException- if the constructor does not exist
-
-
Method Details
-
supports
Whether the supplied principal can be serialized.- Specified by:
supportsin interfacePrincipalSerializer<T extends Principal>- Overrides:
supportsin classSimplePrincipalSerializer<T extends Principal>- Parameters:
principal- to examine- Returns:
- whether principal can be serialized
-
supports
Whether the supplied value can be deserialized.- Specified by:
supportsin interfacePrincipalSerializer<T extends Principal>- Overrides:
supportsin classSimplePrincipalSerializer<T extends Principal>- Parameters:
value- to examine- Returns:
- whether value can be deserialized
-
getName
Return the appropriate value to serialize from the input object.- Overrides:
getNamein classSimplePrincipalSerializer<T extends Principal>- Parameters:
principal- input object- Returns:
- the value to serialize.
- Throws:
IOException- if an error occurs
-
getName
Return the appropriate value to create thePrincipalaround based on the serialized form.- Overrides:
getNamein classSimplePrincipalSerializer<T extends Principal>- Parameters:
serializedName- the value in the serialization.- Returns:
- the transformed value
- Throws:
IOException- if an error occurs