Interface AgreementMethod
-
- All Known Implementing Classes:
AgreementMethodImpl
public interface AgreementMethodA 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 anAgreementMethodelement 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
AgreementMethodelement 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
AgreementMethodelement appears as the content of ads:KeyInfosince, like otherds:KeyInfochildren, it yields a key. Thisds:KeyInfois in turn a child of anEncryptedDataorEncryptedKeyelement. The Algorithm attribute and KeySize child of theEncryptionMethodelement under thisEncryptedDataorEncryptedKeyelement are implicit parameters to the key agreement computation. In cases where thisEncryptionMethodalgorithmURIis insufficient to determine the key length, a KeySize MUST have been included. In addition, the sender may place a KA-Nonce element underAgreementMethodto 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
AgreementMethodwould appear inside ads:KeyInfoinside anEncryptedKeyelement.The Schema for AgreementMethod is as follows:
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddAgreementMethodInformation(Element info)Adds additionalAgreementMethodinformation.Iterator<Element>getAgreementMethodInformation()Returns additional information regarding theAgreementMethod.StringgetAlgorithm()Returns the algorithm URI of thisCryptographicMethod.byte[]getKANonce()Returns abytearray.KeyDerivationMethodgetKeyDerivationMethod()Returns KeyDerivationMethod information used in theAgreementMethod.OriginatorKeyInfogetOriginatorKeyInfo()Returns information relating to the originator's shared secret.RecipientKeyInfogetRecipientKeyInfo()Returns information relating to the recipient's shared secret.voidremoveAgreementMethodInformation(Element info)Removes additionalAgreementMethodinformation.voidsetKANonce(byte[] kanonce)Sets the KANonce.jjvoidsetKeyDerivationMethod(KeyDerivationMethod keyDerivationMethod)This method is used to set theKeyDerivationMethodwhen theAgreementMethodis being used to derive a key.voidsetOriginatorKeyInfo(OriginatorKeyInfo keyInfo)Sets the information relating to the originator's shared secret.voidsetOriginatorPublicKey(PublicKey publicKey)Sets the originator's PublicKey to generate the secretvoidsetRecipientKeyInfo(RecipientKeyInfo keyInfo)Sets the information relating to the recipient's shared secret.
-
-
-
Method Detail
-
getKANonce
byte[] getKANonce()
Returns abytearray.- Returns:
- a
bytearray.
-
setKANonce
void setKANonce(byte[] kanonce)
Sets the KANonce.jj- Parameters:
kanonce-
-
getKeyDerivationMethod
KeyDerivationMethod getKeyDerivationMethod() throws XMLSecurityException
Returns KeyDerivationMethod information used in theAgreementMethod.- Returns:
- The KeyDerivationMethod information regarding the
AgreementMethod. - Throws:
XMLSecurityException
-
setKeyDerivationMethod
void setKeyDerivationMethod(KeyDerivationMethod keyDerivationMethod)
This method is used to set theKeyDerivationMethodwhen theAgreementMethodis being used to derive a key. TheKeyDerivationMethodis declared asbut is used in ECDH_ES - Parameters:
keyDerivationMethod-
-
getAgreementMethodInformation
Iterator<Element> getAgreementMethodInformation()
Returns additional information regarding theAgreementMethod.- Returns:
- additional information regarding the
AgreementMethod.
-
addAgreementMethodInformation
void addAgreementMethodInformation(Element info)
Adds additionalAgreementMethodinformation.- Parameters:
info- aElementthat represents additional information specified by
-
removeAgreementMethodInformation
void removeAgreementMethodInformation(Element info)
Removes additionalAgreementMethodinformation.- Parameters:
info- aElementthat represents additional information specified by
-
getOriginatorKeyInfo
OriginatorKeyInfo getOriginatorKeyInfo() throws XMLSecurityException
Returns information relating to the originator's shared secret.- Returns:
- information relating to the originator's shared secret.
- Throws:
XMLSecurityException
-
setOriginatorKeyInfo
void setOriginatorKeyInfo(OriginatorKeyInfo keyInfo)
Sets the information relating to the originator's shared secret.- Parameters:
keyInfo- information relating to the originator's shared secret.
-
setOriginatorPublicKey
void setOriginatorPublicKey(PublicKey publicKey)
Sets the originator's PublicKey to generate the secret- Parameters:
publicKey- originator's PublicKey
-
getRecipientKeyInfo
RecipientKeyInfo getRecipientKeyInfo() throws XMLSecurityException
Returns information relating to the recipient's shared secret.- Returns:
- information relating to the recipient's shared secret.
- Throws:
XMLSecurityException
-
setRecipientKeyInfo
void setRecipientKeyInfo(RecipientKeyInfo keyInfo)
Sets the information relating to the recipient's shared secret.- Parameters:
keyInfo- information relating to the recipient's shared secret.
-
getAlgorithm
String getAlgorithm()
Returns the algorithm URI of thisCryptographicMethod.- Returns:
- the algorithm URI of this
CryptographicMethod
-
-