public class StaticKeyInfoGenerator extends Object implements KeyInfoGenerator
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.Modifier and Type | Field and Description |
---|---|
private KeyInfo |
keyInfo
The KeyInfo object held by this generator instance.
|
private Marshaller |
keyInfoMarshaller
Marshaller used in cloning operation.
|
private Unmarshaller |
keyInfoUnmarshaller
Unmarshaller used in cloning operation.
|
Constructor and Description |
---|
StaticKeyInfoGenerator(KeyInfo newKeyInfo)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
private KeyInfo |
clone(KeyInfo origKeyInfo)
Clone a KeyInfo and return the new object.
|
KeyInfo |
generate(Credential credential)
Generate a new KeyInfo object based on keying material and other information within a credential.
|
KeyInfo |
getKeyInfo()
Get the static KeyInfo object held by this generator.
|
private Marshaller |
getMarshaller()
Get a KeyInfo marshaller.
|
private Unmarshaller |
getUnmarshaller()
Get a KeyInfo unmarshaller.
|
void |
setKeyInfo(KeyInfo newKeyInfo)
Set the static KeyInfo object held by this generator.
|
private KeyInfo keyInfo
private Unmarshaller keyInfoUnmarshaller
private Marshaller keyInfoMarshaller
public StaticKeyInfoGenerator(KeyInfo newKeyInfo)
newKeyInfo
- the KeyInfo used as the basis to return new KeyInfo objects from this generatorpublic KeyInfo generate(Credential credential) throws SecurityException
generate
in interface KeyInfoGenerator
credential
- the credential containing keying material and possibly other informationSecurityException
- thrown if there is any error generating the new KeyInfo from the credentialpublic KeyInfo getKeyInfo()
public void setKeyInfo(KeyInfo newKeyInfo)
newKeyInfo
- the new KeyInfo objectprivate KeyInfo clone(KeyInfo origKeyInfo) throws SecurityException
origKeyInfo
- the KeyInfo object to cloneSecurityException
- thrown in there are marshalling or unmarshalling errors during cloningprivate Marshaller getMarshaller() throws SecurityException
SecurityException
- thrown if there is an error obtaining the marshaller from the configurationprivate Unmarshaller getUnmarshaller() throws SecurityException
SecurityException
- thrown if there is an error obtaining the unmarshaller from the configurationCopyright © 1999–2017. All rights reserved.