Package org.apache.wss4j.common.crypto
Class AlgorithmSuiteValidator
- java.lang.Object
-
- org.apache.wss4j.common.crypto.AlgorithmSuiteValidator
-
public class AlgorithmSuiteValidator extends Object
Validate signature/encryption/etc. algorithms against an AlgorithmSuite policy.
-
-
Constructor Summary
Constructors Constructor Description AlgorithmSuiteValidator(AlgorithmSuite algorithmSuite)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcheckAsymmetricKeyLength(X509Certificate x509Certificate)Check the asymmetric key lengthvoidcheckAsymmetricKeyLength(X509Certificate[] x509Certificates)Check the asymmetric key lengthvoidcheckAsymmetricKeyLength(PublicKey publicKey)Check the asymmetric key lengthvoidcheckC14nAlgorithm(String c14nAlgorithm)Check the C14n AlgorithmvoidcheckDerivedKeyAlgorithm(String algorithm)Check Derived Key algorithmvoidcheckEncryptionDerivedKeyLength(int derivedKeyLength)Check Encryption Derived Key length (in bytes)voidcheckEncryptionKeyWrapAlgorithm(String keyWrapAlgorithm)voidcheckKeyAgreementMethodAlgorithm(String keyAgreementMethodAlgorithm)voidcheckKeyDerivationFunction(String keyDerivationFunction)Method to check the Key Derivation algorithm is on the approved list of the AlgorithmSuite configuration.voidcheckSignatureAlgorithms(XMLSignature xmlSignature)Check the Signature AlgorithmsvoidcheckSignatureDerivedKeyLength(int derivedKeyLength)Check Signature Derived Key length (in bytes)voidcheckSignatureMethod(String signatureMethod)Check the Signature MethodvoidcheckSymmetricEncryptionAlgorithm(String symmetricAlgorithm)voidcheckSymmetricKeyLength(int secretKeyLength)Check the symmetric key length
-
-
-
Constructor Detail
-
AlgorithmSuiteValidator
public AlgorithmSuiteValidator(AlgorithmSuite algorithmSuite)
-
-
Method Detail
-
checkSignatureMethod
public void checkSignatureMethod(String signatureMethod) throws WSSecurityException
Check the Signature Method- Throws:
WSSecurityException
-
checkC14nAlgorithm
public void checkC14nAlgorithm(String c14nAlgorithm) throws WSSecurityException
Check the C14n Algorithm- Throws:
WSSecurityException
-
checkSignatureAlgorithms
public void checkSignatureAlgorithms(XMLSignature xmlSignature) throws WSSecurityException
Check the Signature Algorithms- Throws:
WSSecurityException
-
checkEncryptionKeyWrapAlgorithm
public void checkEncryptionKeyWrapAlgorithm(String keyWrapAlgorithm) throws WSSecurityException
- Throws:
WSSecurityException
-
checkKeyAgreementMethodAlgorithm
public void checkKeyAgreementMethodAlgorithm(String keyAgreementMethodAlgorithm) throws WSSecurityException
- Throws:
WSSecurityException
-
checkKeyDerivationFunction
public void checkKeyDerivationFunction(String keyDerivationFunction) throws WSSecurityException
Method to check the Key Derivation algorithm is on the approved list of the AlgorithmSuite configuration.- Parameters:
keyDerivationFunction- the key derivation function to be validated- Throws:
WSSecurityException- if the approved list is not empty and the key derivation function is not on the list
-
checkSymmetricEncryptionAlgorithm
public void checkSymmetricEncryptionAlgorithm(String symmetricAlgorithm) throws WSSecurityException
- Throws:
WSSecurityException
-
checkAsymmetricKeyLength
public void checkAsymmetricKeyLength(X509Certificate[] x509Certificates) throws WSSecurityException
Check the asymmetric key length- Throws:
WSSecurityException
-
checkAsymmetricKeyLength
public void checkAsymmetricKeyLength(X509Certificate x509Certificate) throws WSSecurityException
Check the asymmetric key length- Throws:
WSSecurityException
-
checkAsymmetricKeyLength
public void checkAsymmetricKeyLength(PublicKey publicKey) throws WSSecurityException
Check the asymmetric key length- Throws:
WSSecurityException
-
checkSymmetricKeyLength
public void checkSymmetricKeyLength(int secretKeyLength) throws WSSecurityExceptionCheck the symmetric key length- Throws:
WSSecurityException
-
checkSignatureDerivedKeyLength
public void checkSignatureDerivedKeyLength(int derivedKeyLength) throws WSSecurityExceptionCheck Signature Derived Key length (in bytes)- Throws:
WSSecurityException
-
checkEncryptionDerivedKeyLength
public void checkEncryptionDerivedKeyLength(int derivedKeyLength) throws WSSecurityExceptionCheck Encryption Derived Key length (in bytes)- Throws:
WSSecurityException
-
checkDerivedKeyAlgorithm
public void checkDerivedKeyAlgorithm(String algorithm) throws WSSecurityException
Check Derived Key algorithm- Throws:
WSSecurityException
-
-