public final class XMLCipherUtil extends Object
| Constructor and Description |
|---|
XMLCipherUtil() |
| Modifier and Type | Method and Description |
|---|---|
static KeyAgreementParameters |
constructAgreementParameters(String agreementAlgorithmURI,
KeyAgreementParameters.ActorType actorType,
KeyDerivationParameters keyDerivationParameter,
PrivateKey keyAgreementPrivateKey,
PublicKey keyAgreementPublicKey)
Construct an KeyAgreementParameterSpec object from the given parameters
|
static AlgorithmParameterSpec |
constructBlockCipherParameters(boolean gcmAlgorithm,
byte[] iv) |
static AlgorithmParameterSpec |
constructBlockCipherParameters(String algorithm,
byte[] iv)
Build an
AlgorithmParameterSpec instance used to initialize a Cipher instance
for block cipher encryption and decryption. |
static ConcatKDFParams |
constructConcatKeyDerivationParameter(int keyBitLength,
String digestMethod)
Construct a ConcatKeyDerivationParameter object from the key length and digest method.
|
static ConcatKDFParams |
constructConcatKeyDerivationParameter(int keyBitLength,
String digestMethod,
String algorithmId,
String partyUInfo,
String partyVInfo,
String suppPubInfo,
String suppPrivInfo)
Construct a ConcatKeyDerivationParameter object from the given parameters
|
static KeyDerivationParameters |
constructKeyDerivationParameter(KeyDerivationMethod keyDerivationMethod,
int keyBitLength)
Construct a KeyDerivationParameter object from the given keyDerivationMethod and keyBitLength
|
static MGF1ParameterSpec |
constructMGF1Parameter(String mgh1AlgorithmURI)
Create MGF1ParameterSpec for the given algorithm URI
|
static OAEPParameterSpec |
constructOAEPParameters(String encryptionAlgorithmURI,
String digestAlgorithmURI,
String mgfAlgorithmURI,
byte[] oaepParams)
Method buildOAEPParameters from given parameters and returns OAEPParameterSpec.
|
static KeyAgreementParameters |
constructRecipientKeyAgreementParameters(String keyWrapAlgoURI,
AgreementMethod agreementMethod,
PrivateKey keyAgreementPrivateKey)
Construct an KeyAgreementParameterSpec object from the given parameters
|
static String |
getMgf1URIForParameter(MGF1ParameterSpec parameterSpec)
Get the MGF1 algorithm URI for the given MGF1ParameterSpec
|
public static AlgorithmParameterSpec constructBlockCipherParameters(String algorithm, byte[] iv)
AlgorithmParameterSpec instance used to initialize a Cipher instance
for block cipher encryption and decryption.algorithm - the XML encryption algorithm URIiv - the initialization vectorpublic static AlgorithmParameterSpec constructBlockCipherParameters(boolean gcmAlgorithm, byte[] iv)
public static OAEPParameterSpec constructOAEPParameters(String encryptionAlgorithmURI, String digestAlgorithmURI, String mgfAlgorithmURI, byte[] oaepParams)
encryptionAlgorithmURI - the encryption algorithm URI (RSA_OAEP or RSA_OAEP_11)digestAlgorithmURI - the digest algorithm URImgfAlgorithmURI - the MGF algorithm URI if encryptionAlgorithmURI is RSA_OAEP_11, otherwise parameter is ignoredoaepParams - the OAEP parameters bytespublic static MGF1ParameterSpec constructMGF1Parameter(String mgh1AlgorithmURI)
mgh1AlgorithmURI - the algorithm URI. If null or empty, SHA-1 is used as default MGF1 digest algorithm.public static String getMgf1URIForParameter(MGF1ParameterSpec parameterSpec)
parameterSpec - the MGF1ParameterSpecpublic static KeyAgreementParameters constructRecipientKeyAgreementParameters(String keyWrapAlgoURI, AgreementMethod agreementMethod, PrivateKey keyAgreementPrivateKey) throws XMLSecurityException
keyWrapAlgoURI - key wrap algorithmagreementMethod - agreement methodkeyAgreementPrivateKey - private key to derive the shared secret in case of Diffie-Hellman key agreementsXMLSecurityExceptionpublic static KeyAgreementParameters constructAgreementParameters(String agreementAlgorithmURI, KeyAgreementParameters.ActorType actorType, KeyDerivationParameters keyDerivationParameter, PrivateKey keyAgreementPrivateKey, PublicKey keyAgreementPublicKey)
agreementAlgorithmURI - agreement algorithmkeyDerivationParameter - key derivation parameters (e.g. ConcatKDFParams for ConcatKDF key derivation)keyAgreementPrivateKey - private key to derive the shared secret in case of Diffie-Hellman key agreementskeyAgreementPublicKey - public key to derive the shared secret in case of Diffie-Hellman key agreementspublic static KeyDerivationParameters constructKeyDerivationParameter(KeyDerivationMethod keyDerivationMethod, int keyBitLength) throws XMLSecurityException
keyDerivationMethod - element to parsekeyBitLength - expected derived key lengthXMLSecurityException - if the keyDerivationMethod is not supportedpublic static ConcatKDFParams constructConcatKeyDerivationParameter(int keyBitLength, String digestMethod)
keyBitLength - expected derived key lengthdigestMethod - digest methodpublic static ConcatKDFParams constructConcatKeyDerivationParameter(int keyBitLength, String digestMethod, String algorithmId, String partyUInfo, String partyVInfo, String suppPubInfo, String suppPrivInfo)
keyBitLength - expected derived key lengthdigestMethod - digest methodalgorithmId - algorithm idpartyUInfo - partyUInfopartyVInfo - partyVInfosuppPubInfo - suppPubInfosuppPrivInfo - suppPrivInfoCopyright © 2000–2024 The Apache Software Foundation. All rights reserved.