public class AgreementMethodImpl extends EncryptionElementProxy implements KeyInfoContent, AgreementMethod
baseURI| Constructor and Description |
|---|
AgreementMethodImpl(Document doc,
KeyAgreementParameters keyAgreementParameter)
Constructor AgreementMethodImpl for generating AgreementMethod from scratch based on
KeyAgreementParameters. |
AgreementMethodImpl(Document doc,
String algorithm)
Constructor AgreementMethodImpl for generating AgreementMethod from scratch based on algorithm URI.
|
AgreementMethodImpl(Element element)
Constructor AgreementMethodImpl based on XML
Element. |
| Modifier and Type | Method and Description |
|---|---|
void |
addAgreementMethodInformation(Element info)
Adds additional
AgreementMethod information. |
Iterator<Element> |
getAgreementMethodInformation()
Returns additional information regarding the
AgreementMethod. |
String |
getAlgorithm()
Returns the algorithm URI of this
CryptographicMethod. |
String |
getBaseLocalName()
Returns the localname of the Elements of the sub-class.
|
byte[] |
getKANonce()
Returns a
byte array. |
KeyDerivationMethod |
getKeyDerivationMethod()
Returns KeyDerivationMethod information used in the
AgreementMethod. |
OriginatorKeyInfo |
getOriginatorKeyInfo()
Returns information relating to the originator's shared secret.
|
RecipientKeyInfo |
getRecipientKeyInfo()
Returns information relating to the recipient's shared secret.
|
void |
removeAgreementMethodInformation(Element info)
Removes additional
AgreementMethod information. |
void |
setKANonce(byte[] kanonce)
Sets the KANonce.jj
|
void |
setKeyDerivationMethod(KeyDerivationMethod keyDerivationMethod)
This method is used to set the
KeyDerivationMethod when the AgreementMethod is being
used to derive a key. |
void |
setOriginatorKeyInfo(OriginatorKeyInfo keyInfo)
Sets the information relating to the originator's shared secret.
|
void |
setOriginatorPublicKey(PublicKey publicKey)
Sets the originator's PublicKey to generate the secret
|
void |
setRecipientKeyInfo(RecipientKeyInfo keyInfo)
Sets the information relating to the recipient's shared secret.
|
getBaseNamespaceaddBase64Element, addBase64Text, addBigIntegerElement, addReturnToSelf, addText, addTextElement, appendOther, appendSelf, appendSelf, createElementForFamily, createElementForFamilyLocal, createText, getBaseURI, getBigIntegerFromChildElement, getBytesFromTextChild, getDefaultPrefix, getDocument, getElement, getElementPlusReturns, getFirstChild, getLocalAttribute, getTextFromChildElement, getTextFromTextChild, length, registerDefaultPrefixes, setDefaultPrefix, setDocument, setElement, setElement, setLocalAttribute, setLocalIdAttribute, setXPathNamespaceContextpublic AgreementMethodImpl(Document doc, KeyAgreementParameters keyAgreementParameter) throws XMLEncryptionException
KeyAgreementParameters.
The constructor generates KeyDerivationMethod if given and OriginatorKeyInfo based on originator
public key for ECDH-ES key agreement. It generates a placeholder element for RecipientKeyInfo. The recipient key info value
must be set later.doc - the Document in which AgreementMethod will be placedkeyAgreementParameter - the KeyAgreementParameters from which AgreementMethod will be generatedXMLEncryptionException - if the Key derivation algorithm is not supported or invalid parameters are given.public AgreementMethodImpl(Document doc, String algorithm)
KeyDerivationMethod, OriginatorKeyInfo and RecipientKeyInfo. The values for these elements
must be set later.algorithm - the algorithm URI for the key agreement algorithmpublic AgreementMethodImpl(Element element) throws XMLSecurityException
Element.element - the XML Element containing AgreementMethod informationXMLSecurityException - if the AgreementMethod element has invalid XML structurepublic byte[] getKANonce()
byte array.getKANonce in interface AgreementMethodbyte array.public void setKANonce(byte[] kanonce)
setKANonce in interface AgreementMethodpublic Iterator<Element> getAgreementMethodInformation()
AgreementMethod.getAgreementMethodInformation in interface AgreementMethodAgreementMethod.public void addAgreementMethodInformation(Element info)
AgreementMethod information.addAgreementMethodInformation in interface AgreementMethodinfo - a Element that represents additional information
specified by
public void removeAgreementMethodInformation(Element info)
AgreementMethod information.removeAgreementMethodInformation in interface AgreementMethodinfo - a Element that represents additional information
specified by
public KeyDerivationMethod getKeyDerivationMethod() throws XMLSecurityException
AgreementMethod.getKeyDerivationMethod in interface AgreementMethodAgreementMethod.XMLSecurityExceptionpublic void setKeyDerivationMethod(KeyDerivationMethod keyDerivationMethod)
KeyDerivationMethod when the AgreementMethod is being
used to derive a key. The KeyDerivationMethod is declared as setKeyDerivationMethod in interface AgreementMethodpublic OriginatorKeyInfo getOriginatorKeyInfo() throws XMLSecurityException
getOriginatorKeyInfo in interface AgreementMethodXMLSecurityExceptionpublic void setOriginatorKeyInfo(OriginatorKeyInfo keyInfo)
setOriginatorKeyInfo in interface AgreementMethodkeyInfo - information relating to the originator's shared secret.public void setOriginatorPublicKey(PublicKey publicKey)
setOriginatorPublicKey in interface AgreementMethodpublicKey - originator's PublicKeypublic RecipientKeyInfo getRecipientKeyInfo() throws XMLSecurityException
getRecipientKeyInfo in interface AgreementMethodXMLSecurityExceptionpublic void setRecipientKeyInfo(RecipientKeyInfo keyInfo)
setRecipientKeyInfo in interface AgreementMethodkeyInfo - information relating to the recipient's shared secret.public String getAlgorithm()
CryptographicMethod.getAlgorithm in interface AgreementMethodCryptographicMethodpublic String getBaseLocalName()
ElementProxygetBaseLocalName in class ElementProxyCopyright © 2000–2024 The Apache Software Foundation. All rights reserved.