Package org.apache.wss4j.stax.ext
Class WSSSecurityProperties
java.lang.Object
org.apache.xml.security.stax.ext.XMLSecurityProperties
org.apache.wss4j.stax.ext.WSSSecurityProperties
public class WSSSecurityProperties
extends org.apache.xml.security.stax.ext.XMLSecurityProperties
Main configuration class to supply keys etc.
This class is subject to change in the future.
Probably we will allow to configure the framework per WSDL
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddIgnoreBSPRule(BSPRule bspRule) voidaddValidator(QName qName, Validator validator) getActor()Get the Audience Restrictionsreturns the password callback handlerreturns the decryptionCrypto for the key-managementReturns the decryption crypto classReturns the decryption keystoreintorg.apache.xml.security.stax.securityToken.SecurityTokenConstants.KeyIdentifierintreturns the encryptionCrypto for the key-managementReturns the encryption crypto classReturns the encryption keystoreReturns the alias for the encryption key in the keystorebooleanGet the Signature Issuer Cert ConstraintsGet the replay cache for NoncesGet the replay cache for SAML2 OneTimeUse AssertionsGet the Signature Subject Cert ConstraintsGet the replay cache for TimestampsgetUtTTL()<T extends Validator>
TgetValidator(QName qName) booleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanisSoap12()booleanbooleanbooleanbooleanbooleanvoidloadCRLCertStore(URL url) voidloadDecryptionKeystore(URL url, char[] keyStorePassword) loads a java keystore from the given url for decrypt operationsvoidloadEncryptionKeystore(URL url, char[] keyStorePassword) loads a java keystore from the given url for encrypt operationsvoidloadSignatureKeyStore(URL url, char[] keyStorePassword) voidloadSignatureVerificationKeystore(URL url, char[] keyStorePassword) voidvoidsetAddUsernameTokenCreated(boolean addUsernameTokenCreated) voidsetAddUsernameTokenNonce(boolean addUsernameTokenNonce) voidsetAllowRSA15KeyTransportAlgorithm(boolean allowRSA15KeyTransportAlgorithm) voidsetAllowUsernameTokenNoPassword(boolean allowUsernameTokenNoPassword) voidsetAttachmentCallbackHandler(CallbackHandler attachmentCallbackHandler) voidsetAudienceRestrictions(List<String> audienceRestrictions) Set the Audience RestrictionsvoidsetCallbackHandler(CallbackHandler callbackHandler) sets the password callback handlervoidsetCrlCertStore(CertStore crlCertStore) voidsetDecryptionCrypto(Crypto decCrypto) voidsetDecryptionCryptoClass(Class<? extends Merlin> decryptionCryptoClass) Sets a custom decryption classvoidsetDecryptionCryptoProperties(Properties cryptoProperties) voidsetDecryptionCryptoProperties(Properties cryptoProperties, PasswordEncryptor passwordEncryptor) voidsetDerivedEncryptionKeyLength(int derivedEncryptionKeyLength) voidsetDerivedKeyIterations(Integer derivedKeyIterations) voidsetDerivedKeyKeyIdentifier(org.apache.xml.security.stax.securityToken.SecurityTokenConstants.KeyIdentifier derivedKeyKeyIdentifier) voidsetDerivedKeyTokenReference(WSSConstants.DerivedKeyTokenReference derivedKeyTokenReference) voidsetDerivedSignatureKeyLength(int derivedSignatureKeyLength) voidsetDisableBSPEnforcement(boolean disableBSPEnforcement) voidsetDocumentCreator(DocumentCreator documentCreator) voidsetEnableRevocation(boolean enableRevocation) voidsetEnableSignatureConfirmationVerification(boolean enableSignatureConfirmationVerification) voidsetEncryptionCompressionAlgorithm(String encryptionCompressionAlgorithm) voidsetEncryptionCrypto(Crypto encCrypto) voidsetEncryptionCryptoClass(Class<? extends Merlin> encryptionCryptoClass) Sets a custom encryption classvoidsetEncryptionCryptoProperties(Properties cryptoProperties) voidsetEncryptionCryptoProperties(Properties cryptoProperties, PasswordEncryptor passwordEncryptor) voidsetEncryptionUser(String encryptionUser) Specifies the the alias for the encryption key in the keystorevoidsetEncryptSymmetricEncryptionKey(boolean encryptSymmetricEncrytionKey) voidsetHandleCustomPasswordTypes(boolean handleCustomTypes) voidsetIncludeEncryptionToken(boolean includeEncryptionToken) voidsetIncludeSignatureToken(boolean includeSignatureToken) voidsetIssuerDNConstraints(Collection<Pattern> issuerDNPatterns) Set the Signature Issuer Cert ConstraintsvoidsetMsgContext(Object msgContext) voidsetMustUnderstand(boolean mustUnderstand) voidsetNonceReplayCache(ReplayCache newCache) Set the replay cache for NoncesvoidsetRequireTimestampExpires(boolean requireTimestampExpires) voidsetSamlCallbackHandler(CallbackHandler samlCallbackHandler) voidsetSamlOneTimeUseReplayCache(ReplayCache newCache) Set the replay cache for SAML2 OneTimeUse AssertionsvoidsetSignatureCrypto(Crypto sigCrypto) voidsetSignatureCryptoClass(Class<? extends Merlin> signatureCryptoClass) voidsetSignatureCryptoProperties(Properties cryptoProperties) voidsetSignatureCryptoProperties(Properties cryptoProperties, PasswordEncryptor passwordEncryptor) voidsetSignatureUser(String signatureUser) voidsetSignatureVerificationCrypto(Crypto sigVerCrypto) voidsetSignatureVerificationCryptoClass(Class<? extends Merlin> signatureVerificationCryptoClass) voidsetSignatureVerificationCryptoProperties(Properties cryptoProperties) voidsetSignatureVerificationCryptoProperties(Properties cryptoProperties, PasswordEncryptor passwordEncryptor) voidsetSoap12(boolean soap12) voidsetStrictTimestampCheck(boolean strictTimestampCheck) voidsetSubjectCertConstraints(Collection<Pattern> subjectCertConstraints) Set the Signature Subject Cert ConstraintsvoidsetTimeStampFutureTTL(Integer timeStampFutureTTL) voidsetTimestampReplayCache(ReplayCache newCache) Set the replay cache for TimestampsvoidsetTimestampTTL(Integer timestampTTL) voidsetTokenUser(String tokenUser) voidsetUse200512Namespace(boolean use200512Namespace) voidsetUseDerivedKeyForMAC(boolean useDerivedKeyForMAC) voidsetUseReqSigCertForEncryption(boolean useReqSigCertForEncryption) voidsetUsernameTokenPasswordType(WSSConstants.UsernameTokenPasswordType usernameTokenPasswordType) voidsetUtFutureTTL(Integer utFutureTTL) voidvoidsetValidateSamlSubjectConfirmation(boolean validateSamlSubjectConfirmation) Methods inherited from class org.apache.xml.security.stax.ext.XMLSecurityProperties
addAction, addEncryptionPart, addInputProcessor, addKeyNameMapping, addSignaturePart, getActions, getAlgorithmParameterSpec, getDecryptionKey, getEncryptionKey, getEncryptionKeyIdentifier, getEncryptionKeyName, getEncryptionKeyTransportAlgorithm, getEncryptionKeyTransportDigestAlgorithm, getEncryptionKeyTransportMGFAlgorithm, getEncryptionKeyTransportOAEPParams, getEncryptionSecureParts, getEncryptionSymAlgorithm, getEncryptionTransportKey, getEncryptionUseThisCertificate, getIdAttributeNS, getInputProcessorList, getKeyNameMap, getSignatureAlgorithm, getSignatureCanonicalizationAlgorithm, getSignatureCerts, getSignatureDigestAlgorithm, getSignatureKey, getSignatureKeyIdentifier, getSignatureKeyIdentifiers, getSignatureKeyName, getSignaturePosition, getSignaturePositionQName, getSignatureSecureParts, getSignatureVerificationKey, isAddExcC14NInclusivePrefixes, isDisableSchemaValidation, isSignatureGenerateIds, isSignatureIncludeDigestTransform, isSignaturePositionStart, isSkipDocumentEvents, isUseSingleCert, setActions, setAddExcC14NInclusivePrefixes, setAlgorithmParameterSpec, setDecryptionKey, setDisableSchemaValidation, setEncryptionKey, setEncryptionKeyIdentifier, setEncryptionKeyName, setEncryptionKeyTransportAlgorithm, setEncryptionKeyTransportDigestAlgorithm, setEncryptionKeyTransportMGFAlgorithm, setEncryptionKeyTransportOAEPParams, setEncryptionSymAlgorithm, setEncryptionTransportKey, setEncryptionUseThisCertificate, setIdAttributeNS, setSignatureAlgorithm, setSignatureCanonicalizationAlgorithm, setSignatureCerts, setSignatureDigestAlgorithm, setSignatureGenerateIds, setSignatureIncludeDigestTransform, setSignatureKey, setSignatureKeyIdentifier, setSignatureKeyIdentifiers, setSignatureKeyName, setSignaturePosition, setSignaturePositionQName, setSignaturePositionStart, setSignatureVerificationKey, setSkipDocumentEvents, setUseSingleCert
-
Constructor Details
-
WSSSecurityProperties
public WSSSecurityProperties() -
WSSSecurityProperties
-
-
Method Details
-
getCallbackHandler
returns the password callback handler- Returns:
- the password callback handler
-
setCallbackHandler
sets the password callback handler- Parameters:
callbackHandler- the password callback handler
-
getTimestampTTL
-
setTimestampTTL
-
isStrictTimestampCheck
public boolean isStrictTimestampCheck() -
setStrictTimestampCheck
public void setStrictTimestampCheck(boolean strictTimestampCheck) -
setHandleCustomPasswordTypes
public void setHandleCustomPasswordTypes(boolean handleCustomTypes) - Parameters:
handleCustomTypes- whether to handle custom UsernameToken password types or not
-
getHandleCustomPasswordTypes
public boolean getHandleCustomPasswordTypes()- Returns:
- whether custom UsernameToken password types are allowed or not
-
getTokenUser
-
setTokenUser
-
getUsernameTokenPasswordType
-
setUsernameTokenPasswordType
public void setUsernameTokenPasswordType(WSSConstants.UsernameTokenPasswordType usernameTokenPasswordType) -
isEnableSignatureConfirmationVerification
public boolean isEnableSignatureConfirmationVerification() -
setEnableSignatureConfirmationVerification
public void setEnableSignatureConfirmationVerification(boolean enableSignatureConfirmationVerification) -
isUseReqSigCertForEncryption
public boolean isUseReqSigCertForEncryption() -
setUseReqSigCertForEncryption
public void setUseReqSigCertForEncryption(boolean useReqSigCertForEncryption) -
getActor
-
setActor
-
getDerivedKeyKeyIdentifier
public org.apache.xml.security.stax.securityToken.SecurityTokenConstants.KeyIdentifier getDerivedKeyKeyIdentifier() -
setDerivedKeyKeyIdentifier
public void setDerivedKeyKeyIdentifier(org.apache.xml.security.stax.securityToken.SecurityTokenConstants.KeyIdentifier derivedKeyKeyIdentifier) -
getDerivedKeyTokenReference
-
setDerivedKeyTokenReference
public void setDerivedKeyTokenReference(WSSConstants.DerivedKeyTokenReference derivedKeyTokenReference) -
addIgnoreBSPRule
-
getIgnoredBSPRules
-
addValidator
-
getValidator
-
setSignatureUser
-
getSignatureUser
-
getSignatureKeyStore
-
loadSignatureKeyStore
- Throws:
Exception
-
getSignatureCryptoProperties
-
setSignatureCryptoProperties
-
setSignatureCryptoProperties
public void setSignatureCryptoProperties(Properties cryptoProperties, PasswordEncryptor passwordEncryptor) -
getSignatureCryptoClass
-
setSignatureCryptoClass
-
getSignatureCrypto
- Throws:
WSSConfigurationException
-
setSignatureCrypto
-
getSignatureVerificationKeyStore
-
loadSignatureVerificationKeystore
- Throws:
Exception
-
loadCRLCertStore
- Throws:
Exception
-
getSignatureVerificationCryptoProperties
-
setSignatureVerificationCryptoProperties
-
setSignatureVerificationCryptoProperties
public void setSignatureVerificationCryptoProperties(Properties cryptoProperties, PasswordEncryptor passwordEncryptor) -
getSignatureVerificationCryptoClass
-
setSignatureVerificationCryptoClass
-
getSignatureVerificationCrypto
- Throws:
WSSConfigurationException
-
setSignatureVerificationCrypto
-
getDecryptionKeyStore
Returns the decryption keystore- Returns:
- A keystore for decryption operation
-
loadDecryptionKeystore
loads a java keystore from the given url for decrypt operations- Parameters:
url- The URL to the keystorekeyStorePassword- The keyStorePassword- Throws:
Exception- thrown if something goes wrong while loading the keystore
-
getDecryptionCryptoProperties
-
setDecryptionCryptoProperties
-
setDecryptionCryptoProperties
public void setDecryptionCryptoProperties(Properties cryptoProperties, PasswordEncryptor passwordEncryptor) -
getDecryptionCryptoClass
Returns the decryption crypto class- Returns:
- the decryption crypto class
-
setDecryptionCryptoClass
Sets a custom decryption class- Parameters:
decryptionCryptoClass-
-
getDecryptionCrypto
returns the decryptionCrypto for the key-management- Returns:
- A Crypto instance
- Throws:
WSSConfigurationException- thrown if something goes wrong
-
setDecryptionCrypto
-
getEncryptionKeyStore
Returns the encryption keystore- Returns:
- A keystore for encryption operation
-
loadEncryptionKeystore
loads a java keystore from the given url for encrypt operations- Parameters:
url- The URL to the keystorekeyStorePassword- The keyStorePassword- Throws:
Exception- thrown if something goes wrong while loading the keystore
-
getEncryptionCryptoProperties
-
setEncryptionCryptoProperties
-
setEncryptionCryptoProperties
public void setEncryptionCryptoProperties(Properties cryptoProperties, PasswordEncryptor passwordEncryptor) -
getEncryptionCryptoClass
Returns the encryption crypto class- Returns:
- the encryption crypto class
-
setEncryptionCryptoClass
Sets a custom encryption class- Parameters:
encryptionCryptoClass-
-
getEncryptionCrypto
returns the encryptionCrypto for the key-management- Returns:
- A Crypto instance
- Throws:
WSSConfigurationException- thrown if something goes wrong
-
setEncryptionCrypto
-
getEncryptionUser
Returns the alias for the encryption key in the keystore- Returns:
- the alias for the encryption key in the keystore as string
-
setEncryptionUser
Specifies the the alias for the encryption key in the keystore- Parameters:
encryptionUser- the the alias for the encryption key in the keystore as string
-
getEncryptionCompressionAlgorithm
-
setEncryptionCompressionAlgorithm
-
isAllowUsernameTokenNoPassword
public boolean isAllowUsernameTokenNoPassword() -
setAllowUsernameTokenNoPassword
public void setAllowUsernameTokenNoPassword(boolean allowUsernameTokenNoPassword) -
isEnableRevocation
public boolean isEnableRevocation() -
setEnableRevocation
public void setEnableRevocation(boolean enableRevocation) -
getCrlCertStore
-
setCrlCertStore
-
getTimeStampFutureTTL
-
setTimeStampFutureTTL
-
getUtTTL
-
setUtTTL
-
getUtFutureTTL
-
setUtFutureTTL
-
setTimestampReplayCache
Set the replay cache for Timestamps -
getTimestampReplayCache
Get the replay cache for Timestamps- Throws:
WSSecurityException
-
setNonceReplayCache
Set the replay cache for Nonces -
getNonceReplayCache
Get the replay cache for Nonces- Throws:
WSSecurityException
-
setSamlOneTimeUseReplayCache
Set the replay cache for SAML2 OneTimeUse Assertions -
getSamlOneTimeUseReplayCache
Get the replay cache for SAML2 OneTimeUse Assertions- Throws:
WSSecurityException
-
isDisableBSPEnforcement
public boolean isDisableBSPEnforcement() -
setDisableBSPEnforcement
public void setDisableBSPEnforcement(boolean disableBSPEnforcement) -
isAllowRSA15KeyTransportAlgorithm
public boolean isAllowRSA15KeyTransportAlgorithm() -
setAllowRSA15KeyTransportAlgorithm
public void setAllowRSA15KeyTransportAlgorithm(boolean allowRSA15KeyTransportAlgorithm) -
getDerivedKeyIterations
-
setDerivedKeyIterations
-
isUseDerivedKeyForMAC
public boolean isUseDerivedKeyForMAC() -
setUseDerivedKeyForMAC
public void setUseDerivedKeyForMAC(boolean useDerivedKeyForMAC) -
isAddUsernameTokenNonce
public boolean isAddUsernameTokenNonce() -
setAddUsernameTokenNonce
public void setAddUsernameTokenNonce(boolean addUsernameTokenNonce) -
isAddUsernameTokenCreated
public boolean isAddUsernameTokenCreated() -
setAddUsernameTokenCreated
public void setAddUsernameTokenCreated(boolean addUsernameTokenCreated) -
getSamlCallbackHandler
-
setSamlCallbackHandler
-
isValidateSamlSubjectConfirmation
public boolean isValidateSamlSubjectConfirmation() -
setValidateSamlSubjectConfirmation
public void setValidateSamlSubjectConfirmation(boolean validateSamlSubjectConfirmation) -
isMustUnderstand
public boolean isMustUnderstand() -
setMustUnderstand
public void setMustUnderstand(boolean mustUnderstand) -
isIncludeSignatureToken
public boolean isIncludeSignatureToken() -
setIncludeSignatureToken
public void setIncludeSignatureToken(boolean includeSignatureToken) -
isIncludeEncryptionToken
public boolean isIncludeEncryptionToken() -
setIncludeEncryptionToken
public void setIncludeEncryptionToken(boolean includeEncryptionToken) -
isEncryptSymmetricEncryptionKey
public boolean isEncryptSymmetricEncryptionKey() -
setEncryptSymmetricEncryptionKey
public void setEncryptSymmetricEncryptionKey(boolean encryptSymmetricEncrytionKey) -
setSubjectCertConstraints
Set the Signature Subject Cert Constraints -
getSubjectCertConstraints
Get the Signature Subject Cert Constraints -
setIssuerDNConstraints
Set the Signature Issuer Cert Constraints -
getIssuerDNConstraints
Get the Signature Issuer Cert Constraints -
setAudienceRestrictions
Set the Audience Restrictions -
getAudienceRestrictions
Get the Audience Restrictions -
getDerivedSignatureKeyLength
public int getDerivedSignatureKeyLength() -
setDerivedSignatureKeyLength
public void setDerivedSignatureKeyLength(int derivedSignatureKeyLength) -
getDerivedEncryptionKeyLength
public int getDerivedEncryptionKeyLength() -
setDerivedEncryptionKeyLength
public void setDerivedEncryptionKeyLength(int derivedEncryptionKeyLength) -
isUse200512Namespace
public boolean isUse200512Namespace() -
setUse200512Namespace
public void setUse200512Namespace(boolean use200512Namespace) -
getAttachmentCallbackHandler
-
setAttachmentCallbackHandler
-
getMsgContext
-
setMsgContext
-
isRequireTimestampExpires
public boolean isRequireTimestampExpires() -
setRequireTimestampExpires
public void setRequireTimestampExpires(boolean requireTimestampExpires) -
isSoap12
public boolean isSoap12() -
setSoap12
public void setSoap12(boolean soap12) -
getDocumentCreator
-
setDocumentCreator
-