FileDocCategorySizeDatePackage
AgreementMethod.javaAPI DocJava SE 6 API5801Tue Jun 10 00:23:00 BST 2008com.sun.org.apache.xml.internal.security.encryption

AgreementMethod

public interface AgreementMethod
A Key Agreement algorithm provides for the derivation of a shared secret key based on a shared secret computed from certain types of compatible public keys from both the sender and the recipient. Information from the originator to determine the secret is indicated by an optional OriginatorKeyInfo parameter child of an 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:

<element name="AgreementMethod" type="xenc:AgreementMethodType"/> <complexType name="AgreementMethodType" mixed="true"> <sequence> <element name="KA-Nonce" minOccurs="0" type="base64Binary"/> <!-- <element ref="ds:DigestMethod" minOccurs="0"/> --> <any namespace="##other" minOccurs="0" maxOccurs="unbounded"/> <element name="OriginatorKeyInfo" minOccurs="0" type="ds:KeyInfoType"/> <element name="RecipientKeyInfo" minOccurs="0" type="ds:KeyInfoType"/> </sequence> <attribute name="Algorithm" type="anyURI" use="required"/> </complexType>
author
Axl Mattheus

Fields Summary
Constructors Summary
Methods Summary
public voidaddAgreementMethodInformation(org.w3c.dom.Element info)
Adds additional AgreementMethod information.

param
info a Element that represents additional information specified by <any namespace="##other" minOccurs="0" maxOccurs="unbounded"/>

public java.util.IteratorgetAgreementMethodInformation()
Returns aditional information regarding the AgreementMethod.

return

public java.lang.StringgetAlgorithm()
Returns the algorithm URI of this CryptographicMethod.

return
the algorithm URI of this CryptographicMethod

public byte[]getKANonce()
Returns an byte array.

return

public com.sun.org.apache.xml.internal.security.keys.KeyInfogetOriginatorKeyInfo()
Returns information relating to the originator's shared secret.

return
information relating to the originator's shared secret.

public com.sun.org.apache.xml.internal.security.keys.KeyInfogetRecipientKeyInfo()
Retruns information relating to the recipient's shared secret.

return
information relating to the recipient's shared secret.

public voidrevoveAgreementMethodInformation(org.w3c.dom.Element info)
Removes additional AgreementMethod information.

param
info a Element that represents additional information specified by <any namespace="##other" minOccurs="0" maxOccurs="unbounded"/>

public voidsetKANonce(byte[] kanonce)
Sets the KANonce.jj

param
kanonce

public voidsetOriginatorKeyInfo(com.sun.org.apache.xml.internal.security.keys.KeyInfo keyInfo)
Sets the information relating to the originator's shared secret.

param
keyInfo information relating to the originator's shared secret.

public voidsetRecipientKeyInfo(com.sun.org.apache.xml.internal.security.keys.KeyInfo keyInfo)
Sets the information relating to the recipient's shared secret.

param
keyInfo information relating to the recipient's shared secret.