Package org.opensaml.xmlsec.keyinfo.impl
Class StaticKeyInfoGenerator
java.lang.Object
org.opensaml.xmlsec.keyinfo.impl.StaticKeyInfoGenerator
- All Implemented Interfaces:
KeyInfoGenerator
Implementation of
KeyInfoGenerator which always returns static KeyInfo data.
Note that the argument to generate(Credential) is not used in generating the new KeyInfo,
and so may be null.
If the original KeyInfo that was passed to this instance is already the child of some other
XMLObject at the time generate(Credential) is called, then a newly constructed KeyInfo
object will be returned that contains the same data as the original. Otherwise, the original
KeyInfo instance is returned directly.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate KeyInfoThe KeyInfo object held by this generator instance.private MarshallerMarshaller used in cloning operation.private UnmarshallerUnmarshaller used in cloning operation. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate KeyInfoClone a KeyInfo and return the new object.generate(Credential credential) Generate a new KeyInfo object based on keying material and other information within a credential.Get the static KeyInfo object held by this generator.private MarshallerGet a KeyInfo marshaller.private UnmarshallerGet a KeyInfo unmarshaller.voidsetKeyInfo(KeyInfo newKeyInfo) Set the static KeyInfo object held by this generator.
-
Field Details
-
keyInfo
The KeyInfo object held by this generator instance. -
keyInfoUnmarshaller
Unmarshaller used in cloning operation. -
keyInfoMarshaller
Marshaller used in cloning operation.
-
-
Constructor Details
-
StaticKeyInfoGenerator
Constructor.- Parameters:
newKeyInfo- the KeyInfo used as the basis to return new KeyInfo objects from this generator
-
-
Method Details
-
generate
Generate a new KeyInfo object based on keying material and other information within a credential.- Specified by:
generatein interfaceKeyInfoGenerator- Parameters:
credential- the credential containing keying material and possibly other information- Returns:
- a new KeyInfo object or null if nothing was generated
- Throws:
SecurityException- thrown if there is any error generating the new KeyInfo from the credential
-
getKeyInfo
Get the static KeyInfo object held by this generator.- Returns:
- the currently held KeyInfo object
-
setKeyInfo
Set the static KeyInfo object held by this generator.- Parameters:
newKeyInfo- the new KeyInfo object
-
clone
Clone a KeyInfo and return the new object.- Parameters:
origKeyInfo- the KeyInfo object to clone- Returns:
- a new KeyInfo object cloned from the original
- Throws:
SecurityException- thrown in there are marshalling or unmarshalling errors during cloning
-
getMarshaller
Get a KeyInfo marshaller.- Returns:
- a KeyInfo marshaller
- Throws:
SecurityException- thrown if there is an error obtaining the marshaller from the configuration
-
getUnmarshaller
Get a KeyInfo unmarshaller.- Returns:
- a KeyInfo unmarshaller
- Throws:
SecurityException- thrown if there is an error obtaining the unmarshaller from the configuration
-