public interface AgreementMethod
AgreementMethod element while that
associated with the recipient is indicated by an optional RecipientKeyInfo. A
shared key is derived from this shared secret by a method determined by the
Key Agreement algorithm.
Note: XML Encryption does not provide an on-line key agreement
negotiation protocol. The AgreementMethod element can be used by
the originator to identify the keys and computational procedure that were
used to obtain a shared encryption key. The method used to obtain or select
the keys or algorithm used for the agreement computation is beyond the scope
of this specification.
The AgreementMethod element appears as the content of a
ds:KeyInfo since, like other ds:KeyInfo children,
it yields a key. This ds:KeyInfo is in turn a child of an
EncryptedData or EncryptedKey element. The
Algorithm attribute and KeySize child of the EncryptionMethod
element under this EncryptedData or EncryptedKey
element are implicit parameters to the key agreement computation. In cases
where this EncryptionMethod algorithm URI is
insufficient to determine the key length, a KeySize MUST have been included.
In addition, the sender may place a KA-Nonce element under
AgreementMethod to assure that different keying material is
generated even for repeated agreements using the same sender and recipient
public keys.
If the agreed key is being used to wrap a key, then
AgreementMethod would appear inside a ds:KeyInfo
inside an EncryptedKey element.
The Schema for AgreementMethod is as follows:
| 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. |
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.
|
byte[] getKANonce()
byte array.byte array.void setKANonce(byte[] kanonce)
kanonce - KeyDerivationMethod getKeyDerivationMethod() throws XMLSecurityException
AgreementMethod.AgreementMethod.XMLSecurityExceptionvoid setKeyDerivationMethod(KeyDerivationMethod keyDerivationMethod)
KeyDerivationMethod when the AgreementMethod is being
used to derive a key. The KeyDerivationMethod is declared as keyDerivationMethod - Iterator<Element> getAgreementMethodInformation()
AgreementMethod.AgreementMethod.void addAgreementMethodInformation(Element info)
AgreementMethod information.info - a Element that represents additional information
specified by
void removeAgreementMethodInformation(Element info)
AgreementMethod information.info - a Element that represents additional information
specified by
OriginatorKeyInfo getOriginatorKeyInfo() throws XMLSecurityException
XMLSecurityExceptionvoid setOriginatorKeyInfo(OriginatorKeyInfo keyInfo)
keyInfo - information relating to the originator's shared secret.void setOriginatorPublicKey(PublicKey publicKey)
publicKey - originator's PublicKeyRecipientKeyInfo getRecipientKeyInfo() throws XMLSecurityException
XMLSecurityExceptionvoid setRecipientKeyInfo(RecipientKeyInfo keyInfo)
keyInfo - information relating to the recipient's shared secret.String getAlgorithm()
CryptographicMethod.CryptographicMethodCopyright © 2000–2025 The Apache Software Foundation. All rights reserved.