Module org.apache.santuario.xmlsec
Package org.apache.xml.security.stax.ext
Class XMLSecurityProperties
- java.lang.Object
-
- org.apache.xml.security.stax.ext.XMLSecurityProperties
-
public class XMLSecurityProperties extends Object
Main configuration class to supply keys etc. This class is subject to change in the future.
-
-
Constructor Summary
Constructors Modifier Constructor Description XMLSecurityProperties()protectedXMLSecurityProperties(XMLSecurityProperties xmlSecurityProperties)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaddAction(XMLSecurityConstants.Action action)voidaddEncryptionPart(SecurePart securePart)Adds a part which must be encrypted by the frameworkvoidaddInputProcessor(InputProcessor inputProcessor)Add an additional, non standard, InputProcessor to the chainvoidaddKeyNameMapping(String keyname, Key key)voidaddSignaturePart(SecurePart securePart)List<XMLSecurityConstants.Action>getActions()Returns the actual set actionsAlgorithmParameterSpecgetAlgorithmParameterSpec()KeygetDecryptionKey()KeygetEncryptionKey()org.apache.xml.security.stax.securityToken.SecurityTokenConstants.KeyIdentifiergetEncryptionKeyIdentifier()returns the KeyIdentifierType which will be used in the secured documentStringgetEncryptionKeyName()StringgetEncryptionKeyTransportAlgorithm()Returns the encryption key transport algorithmStringgetEncryptionKeyTransportDigestAlgorithm()StringgetEncryptionKeyTransportMGFAlgorithm()byte[]getEncryptionKeyTransportOAEPParams()List<SecurePart>getEncryptionSecureParts()Returns the encryption parts which are actually setStringgetEncryptionSymAlgorithm()Returns the Encryption-AlgoKeygetEncryptionTransportKey()X509CertificategetEncryptionUseThisCertificate()QNamegetIdAttributeNS()Return the qualified name of the ID attribute used to sign the document.List<InputProcessor>getInputProcessorList()Returns the currently registered additional InputProcessorsMap<String,Key>getKeyNameMap()returns an immutable instance of the map that links KeyName values to actual keysStringgetSignatureAlgorithm()StringgetSignatureCanonicalizationAlgorithm()X509Certificate[]getSignatureCerts()StringgetSignatureDigestAlgorithm()KeygetSignatureKey()org.apache.xml.security.stax.securityToken.SecurityTokenConstants.KeyIdentifiergetSignatureKeyIdentifier()Deprecated.List<org.apache.xml.security.stax.securityToken.SecurityTokenConstants.KeyIdentifier>getSignatureKeyIdentifiers()StringgetSignatureKeyName()intgetSignaturePosition()returns the position of the signature.QNamegetSignaturePositionQName()List<SecurePart>getSignatureSecureParts()KeygetSignatureVerificationKey()booleanisAddExcC14NInclusivePrefixes()booleanisDisableSchemaValidation()booleanisSignatureGenerateIds()booleanisSignatureIncludeDigestTransform()booleanisSignaturePositionStart()booleanisSkipDocumentEvents()Returns if the framework is skipping document-eventsbooleanisUseSingleCert()voidsetActions(List<XMLSecurityConstants.Action> actions)Specifies how to secure the document eg.voidsetAddExcC14NInclusivePrefixes(boolean addExcC14NInclusivePrefixes)voidsetAlgorithmParameterSpec(AlgorithmParameterSpec algorithmParameterSpec)voidsetDecryptionKey(Key decryptionKey)voidsetDisableSchemaValidation(boolean disableSchemaValidation)voidsetEncryptionKey(Key encryptionKey)voidsetEncryptionKeyIdentifier(org.apache.xml.security.stax.securityToken.SecurityTokenConstants.KeyIdentifier encryptionKeyIdentifier)Specifies the KeyIdentifierType to use in the secured documentvoidsetEncryptionKeyName(String encryptionKeyName)specifies the contents of the KeyInfo/KeyName element for encryptionvoidsetEncryptionKeyTransportAlgorithm(String encryptionKeyTransportAlgorithm)Specifies the encryption key transport algorithmvoidsetEncryptionKeyTransportDigestAlgorithm(String encryptionKeyTransportDigestAlgorithm)voidsetEncryptionKeyTransportMGFAlgorithm(String encryptionKeyTransportMGFAlgorithm)voidsetEncryptionKeyTransportOAEPParams(byte[] encryptionKeyTransportOAEPParams)voidsetEncryptionSymAlgorithm(String encryptionSymAlgorithm)Specifies the encryption algorithmvoidsetEncryptionTransportKey(Key encryptionTransportKey)voidsetEncryptionUseThisCertificate(X509Certificate encryptionUseThisCertificate)voidsetIdAttributeNS(QName idAttributeNS)Sets the qualified name of the ID attribute used to sign the document.voidsetSignatureAlgorithm(String signatureAlgorithm)voidsetSignatureCanonicalizationAlgorithm(String signatureCanonicalizationAlgorithm)voidsetSignatureCerts(X509Certificate[] signatureCerts)voidsetSignatureDigestAlgorithm(String signatureDigestAlgorithm)voidsetSignatureGenerateIds(boolean signatureGenerateIds)specifies if Id attributes should be generated for the document element, the Signature element and KeyInfo structuresvoidsetSignatureIncludeDigestTransform(boolean signatureIncludeDigestTransform)specifies if the transform set with signatureDigestAlgorithm should be included in the Reference/Transforms listvoidsetSignatureKey(Key signatureKey)voidsetSignatureKeyIdentifier(org.apache.xml.security.stax.securityToken.SecurityTokenConstants.KeyIdentifier signatureKeyIdentifier)voidsetSignatureKeyIdentifiers(List<org.apache.xml.security.stax.securityToken.SecurityTokenConstants.KeyIdentifier> signatureKeyIdentifiers)voidsetSignatureKeyName(String signatureKeyName)specifies the contents of the KeyInfo/KeyName element for signingvoidsetSignaturePosition(int signaturePosition)Specifies the position of the signaturevoidsetSignaturePositionQName(QName signaturePositionQName)voidsetSignaturePositionStart(boolean signaturePositionStart)voidsetSignatureVerificationKey(Key signatureVerificationKey)voidsetSkipDocumentEvents(boolean skipDocumentEvents)specifies if the framework should forward Document-Events or notvoidsetUseSingleCert(boolean useSingleCert)
-
-
-
Constructor Detail
-
XMLSecurityProperties
public XMLSecurityProperties()
-
XMLSecurityProperties
protected XMLSecurityProperties(XMLSecurityProperties xmlSecurityProperties)
-
-
Method Detail
-
isSignaturePositionStart
public boolean isSignaturePositionStart()
-
setSignaturePositionStart
public void setSignaturePositionStart(boolean signaturePositionStart)
-
getSignatureKeyIdentifier
@Deprecated public org.apache.xml.security.stax.securityToken.SecurityTokenConstants.KeyIdentifier getSignatureKeyIdentifier()
Deprecated.
-
getSignatureKeyIdentifiers
public List<org.apache.xml.security.stax.securityToken.SecurityTokenConstants.KeyIdentifier> getSignatureKeyIdentifiers()
-
setSignatureKeyIdentifier
public void setSignatureKeyIdentifier(org.apache.xml.security.stax.securityToken.SecurityTokenConstants.KeyIdentifier signatureKeyIdentifier)
-
setSignatureKeyIdentifiers
public void setSignatureKeyIdentifiers(List<org.apache.xml.security.stax.securityToken.SecurityTokenConstants.KeyIdentifier> signatureKeyIdentifiers)
-
getSignaturePosition
public int getSignaturePosition()
returns the position of the signature. By default, the signature is located at the first child of the root element- Returns:
- The signature position
-
setSignaturePosition
public void setSignaturePosition(int signaturePosition)
Specifies the position of the signature- Parameters:
signaturePosition- Position of the signature (by default: 0)
-
getIdAttributeNS
public QName getIdAttributeNS()
Return the qualified name of the ID attribute used to sign the document. By default, ID is used.- Returns:
- the qualified name of the ID attribute
-
setIdAttributeNS
public void setIdAttributeNS(QName idAttributeNS)
Sets the qualified name of the ID attribute used to sign the document.- Parameters:
idAttributeNS- Qualified Name of the ID attribute to use
-
getEncryptionKeyIdentifier
public org.apache.xml.security.stax.securityToken.SecurityTokenConstants.KeyIdentifier getEncryptionKeyIdentifier()
returns the KeyIdentifierType which will be used in the secured document- Returns:
- The KeyIdentifierType
-
setEncryptionKeyIdentifier
public void setEncryptionKeyIdentifier(org.apache.xml.security.stax.securityToken.SecurityTokenConstants.KeyIdentifier encryptionKeyIdentifier)
Specifies the KeyIdentifierType to use in the secured document- Parameters:
encryptionKeyIdentifier-
-
addInputProcessor
public void addInputProcessor(InputProcessor inputProcessor)
Add an additional, non standard, InputProcessor to the chain- Parameters:
inputProcessor- The InputProcessor to add
-
getInputProcessorList
public List<InputProcessor> getInputProcessorList()
Returns the currently registered additional InputProcessors- Returns:
- the List with the InputProcessors
-
setDecryptionKey
public void setDecryptionKey(Key decryptionKey)
-
getDecryptionKey
public Key getDecryptionKey()
-
setEncryptionTransportKey
public void setEncryptionTransportKey(Key encryptionTransportKey)
-
getEncryptionTransportKey
public Key getEncryptionTransportKey()
-
setEncryptionKey
public void setEncryptionKey(Key encryptionKey)
-
getEncryptionKey
public Key getEncryptionKey()
-
addEncryptionPart
public void addEncryptionPart(SecurePart securePart)
Adds a part which must be encrypted by the framework- Parameters:
securePart-
-
getEncryptionSecureParts
public List<SecurePart> getEncryptionSecureParts()
Returns the encryption parts which are actually set- Returns:
- A List of SecurePart's
-
getEncryptionSymAlgorithm
public String getEncryptionSymAlgorithm()
Returns the Encryption-Algo- Returns:
- the Encryption-Algo as String
-
setEncryptionSymAlgorithm
public void setEncryptionSymAlgorithm(String encryptionSymAlgorithm)
Specifies the encryption algorithm- Parameters:
encryptionSymAlgorithm- The algo to use for encryption
-
getEncryptionKeyTransportAlgorithm
public String getEncryptionKeyTransportAlgorithm()
Returns the encryption key transport algorithm- Returns:
- the key transport algorithm as string
-
setEncryptionKeyTransportAlgorithm
public void setEncryptionKeyTransportAlgorithm(String encryptionKeyTransportAlgorithm)
Specifies the encryption key transport algorithm- Parameters:
encryptionKeyTransportAlgorithm- the encryption key transport algorithm as string
-
getEncryptionKeyTransportDigestAlgorithm
public String getEncryptionKeyTransportDigestAlgorithm()
-
setEncryptionKeyTransportDigestAlgorithm
public void setEncryptionKeyTransportDigestAlgorithm(String encryptionKeyTransportDigestAlgorithm)
-
getEncryptionKeyTransportMGFAlgorithm
public String getEncryptionKeyTransportMGFAlgorithm()
-
setEncryptionKeyTransportMGFAlgorithm
public void setEncryptionKeyTransportMGFAlgorithm(String encryptionKeyTransportMGFAlgorithm)
-
getEncryptionKeyTransportOAEPParams
public byte[] getEncryptionKeyTransportOAEPParams()
-
setEncryptionKeyTransportOAEPParams
public void setEncryptionKeyTransportOAEPParams(byte[] encryptionKeyTransportOAEPParams)
-
getEncryptionUseThisCertificate
public X509Certificate getEncryptionUseThisCertificate()
-
setEncryptionUseThisCertificate
public void setEncryptionUseThisCertificate(X509Certificate encryptionUseThisCertificate)
-
getSignatureCerts
public X509Certificate[] getSignatureCerts()
-
setSignatureCerts
public void setSignatureCerts(X509Certificate[] signatureCerts)
-
addSignaturePart
public void addSignaturePart(SecurePart securePart)
-
getSignatureSecureParts
public List<SecurePart> getSignatureSecureParts()
-
getSignatureAlgorithm
public String getSignatureAlgorithm()
-
setSignatureAlgorithm
public void setSignatureAlgorithm(String signatureAlgorithm)
-
getSignatureDigestAlgorithm
public String getSignatureDigestAlgorithm()
-
setSignatureDigestAlgorithm
public void setSignatureDigestAlgorithm(String signatureDigestAlgorithm)
-
setSignatureKey
public void setSignatureKey(Key signatureKey)
-
getSignatureKey
public Key getSignatureKey()
-
isUseSingleCert
public boolean isUseSingleCert()
-
setUseSingleCert
public void setUseSingleCert(boolean useSingleCert)
-
isAddExcC14NInclusivePrefixes
public boolean isAddExcC14NInclusivePrefixes()
-
setAddExcC14NInclusivePrefixes
public void setAddExcC14NInclusivePrefixes(boolean addExcC14NInclusivePrefixes)
-
getActions
public List<XMLSecurityConstants.Action> getActions()
Returns the actual set actions- Returns:
- The Actions in applied order
-
setActions
public void setActions(List<XMLSecurityConstants.Action> actions)
Specifies how to secure the document eg. Timestamp, Signature, Encrypt- Parameters:
actions-
-
addAction
public void addAction(XMLSecurityConstants.Action action)
-
getSignatureCanonicalizationAlgorithm
public String getSignatureCanonicalizationAlgorithm()
-
setSignatureCanonicalizationAlgorithm
public void setSignatureCanonicalizationAlgorithm(String signatureCanonicalizationAlgorithm)
-
getSignatureVerificationKey
public Key getSignatureVerificationKey()
-
setSignatureVerificationKey
public void setSignatureVerificationKey(Key signatureVerificationKey)
-
isSkipDocumentEvents
public boolean isSkipDocumentEvents()
Returns if the framework is skipping document-events- Returns:
- true if document-events will be skipped, false otherwise
-
setSkipDocumentEvents
public void setSkipDocumentEvents(boolean skipDocumentEvents)
specifies if the framework should forward Document-Events or not- Parameters:
skipDocumentEvents- set to true when document events should be discarded, false otherwise
-
isDisableSchemaValidation
public boolean isDisableSchemaValidation()
-
setDisableSchemaValidation
public void setDisableSchemaValidation(boolean disableSchemaValidation)
-
getSignatureKeyName
public String getSignatureKeyName()
-
setSignatureKeyName
public void setSignatureKeyName(String signatureKeyName)
specifies the contents of the KeyInfo/KeyName element for signing- Parameters:
signatureKeyName- set to a String that will be passed as contents of the KeyName element
-
getEncryptionKeyName
public String getEncryptionKeyName()
-
setEncryptionKeyName
public void setEncryptionKeyName(String encryptionKeyName)
specifies the contents of the KeyInfo/KeyName element for encryption- Parameters:
encryptionKeyName- set to a String that will be passed as contents of the KeyName element
-
getKeyNameMap
public Map<String,Key> getKeyNameMap()
returns an immutable instance of the map that links KeyName values to actual keys- Returns:
- keyNameMap set to the map containing KeyNames and Keys
-
isSignatureGenerateIds
public boolean isSignatureGenerateIds()
-
setSignatureGenerateIds
public void setSignatureGenerateIds(boolean signatureGenerateIds)
specifies if Id attributes should be generated for the document element, the Signature element and KeyInfo structures- Parameters:
signatureGenerateIds- set to true (default) to generate Id attributes
-
isSignatureIncludeDigestTransform
public boolean isSignatureIncludeDigestTransform()
-
setSignatureIncludeDigestTransform
public void setSignatureIncludeDigestTransform(boolean signatureIncludeDigestTransform)
specifies if the transform set with signatureDigestAlgorithm should be included in the Reference/Transforms list- Parameters:
signatureIncludeDigestTransform- set to true (default) to include the transform in the list
-
getSignaturePositionQName
public QName getSignaturePositionQName()
-
setSignaturePositionQName
public void setSignaturePositionQName(QName signaturePositionQName)
-
getAlgorithmParameterSpec
public AlgorithmParameterSpec getAlgorithmParameterSpec()
-
setAlgorithmParameterSpec
public void setAlgorithmParameterSpec(AlgorithmParameterSpec algorithmParameterSpec)
-
-