Class KANonce
java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
org.opensaml.xmlsec.agreement.impl.KANonce
- All Implemented Interfaces:
Cloneable,Component,DestructableComponent,InitializableComponent,CloneableKeyAgreementParameter,KeyAgreementParameter,XMLExpressableKeyAgreementParameter
public class KANonce
extends AbstractInitializableComponent
implements XMLExpressableKeyAgreementParameter, CloneableKeyAgreementParameter
Key agreement parameter to support use of
KANonce values.-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final IntegerDefault length for generated salt, in bytes.private IntegerGenerated salt length, in bytes.private SecureRandomSecureRandom generator for salt.private StringBase64-encoded nonce value. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()protected voidstatic KANoncefromXMLObject(KANonce xmlObject) Create and initialize a new instance from the specifiedXMLObject.protected StringGenerate a new random value.Get the generated length, in bytes.Get the secure random generator.getValue()Get the Base64-encoded nonce value.voidsetGeneratedLength(Integer length) Set the generated length, in bytes.voidSet the secure random generator.voidSet the Base64-encoded nonce value.Methods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent
checkComponentActive, checkSetterPreconditions, destroy, doDestroy, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentException, initialize, isDestroyed, isInitialized
-
Field Details
-
DEFAULT_GENERATED_LENGTH
Default length for generated salt, in bytes. -
value
Base64-encoded nonce value. -
generatedLength
Generated salt length, in bytes. -
secureRandom
SecureRandom generator for salt.
-
-
Constructor Details
-
KANonce
public KANonce()
-
-
Method Details
-
getValue
Get the Base64-encoded nonce value.- Returns:
- the nonce value
-
setValue
Set the Base64-encoded nonce value.- Parameters:
newValue- the nonce value
-
getGeneratedLength
Get the generated length, in bytes.- Returns:
- the generated length, in bytes
-
setGeneratedLength
Set the generated length, in bytes.- Parameters:
length- the generated length
-
getRandom
Get the secure random generator.Defaults to the platform default via
new SecureRandom()- Returns:
- the secure random instance
-
setRandom
Set the secure random generator.Defaults to the platform default via
new SecureRandom()- Parameters:
sr- the secure random generator to set
-
doInitialize
- Overrides:
doInitializein classAbstractInitializableComponent- Throws:
ComponentInitializationException
-
generateValue
Generate a new random value.- Returns:
- the generated value
-
clone
- Specified by:
clonein interfaceCloneableKeyAgreementParameter- Overrides:
clonein classObject
-
buildXMLObject
- Specified by:
buildXMLObjectin interfaceXMLExpressableKeyAgreementParameter
-
fromXMLObject
@Nonnull public static KANonce fromXMLObject(@Nonnull KANonce xmlObject) throws ComponentInitializationException Create and initialize a new instance from the specifiedXMLObject.- Parameters:
xmlObject- the XML object- Returns:
- new parameter instance
- Throws:
ComponentInitializationException- if component initialization fails
-