- java.lang.Object
-
- org.apache.xml.security.stax.ext.XMLSecurityUtils
-
public class XMLSecurityUtils extends Object
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedXMLSecurityUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidcopy(InputStream inputStream, OutputStream outputStream)static voidcreateKeyNameTokenStructure(AbstractOutputProcessor abstractOutputProcessor, OutputProcessorChain outputProcessorChain, String keyName)static voidcreateKeyValueTokenStructure(AbstractOutputProcessor abstractOutputProcessor, OutputProcessorChain outputProcessorChain, X509Certificate[] x509Certificates)static voidcreateKeyValueTokenStructure(AbstractOutputProcessor abstractOutputProcessor, OutputProcessorChain outputProcessorChain, PublicKey publicKey)static org.apache.xml.security.stax.securityEvent.TokenSecurityEvent<? extends org.apache.xml.security.stax.securityToken.InboundSecurityToken>createTokenSecurityEvent(org.apache.xml.security.stax.securityToken.InboundSecurityToken inboundSecurityToken, String correlationID)static voidcreateX509CertificateStructure(AbstractOutputProcessor abstractOutputProcessor, OutputProcessorChain outputProcessorChain, X509Certificate[] x509Certificates)static voidcreateX509CertificateStructure(AbstractOutputProcessor abstractOutputProcessor, OutputProcessorChain outputProcessorChain, X509Certificate[] x509Certificates, boolean outputX509Data)static voidcreateX509IssuerSerialStructure(AbstractOutputProcessor abstractOutputProcessor, OutputProcessorChain outputProcessorChain, X509Certificate[] x509Certificates)static voidcreateX509IssuerSerialStructure(AbstractOutputProcessor abstractOutputProcessor, OutputProcessorChain outputProcessorChain, X509Certificate[] x509Certificates, boolean outputX509Data)static voidcreateX509SubjectKeyIdentifierStructure(AbstractOutputProcessor abstractOutputProcessor, OutputProcessorChain outputProcessorChain, X509Certificate[] x509Certificates)static voidcreateX509SubjectKeyIdentifierStructure(AbstractOutputProcessor abstractOutputProcessor, OutputProcessorChain outputProcessorChain, X509Certificate[] x509Certificates, boolean outputX509Data)static voidcreateX509SubjectNameStructure(AbstractOutputProcessor abstractOutputProcessor, OutputProcessorChain outputProcessorChain, X509Certificate[] x509Certificates)static voidcreateX509SubjectNameStructure(AbstractOutputProcessor abstractOutputProcessor, OutputProcessorChain outputProcessorChain, X509Certificate[] x509Certificates, boolean outputX509Data)static StringdropReferenceMarker(String reference)Returns the Id reference without the leading #static Set<String>getExcC14NInclusiveNamespacePrefixes(org.apache.xml.security.stax.ext.stax.XMLSecStartElement xmlSecStartElement, boolean excludeVisible)static StringgetQNameAttribute(Map<QName,String> attributes, QName qName)static <T> TgetQNameType(List<Object> objects, QName qName)static TransformergetTransformer(Transformer transformer, OutputStream outputStream, Map<String,Object> properties, String algorithm, XMLSecurityConstants.DIRECTION direction)static StringgetXMLEventAsString(org.apache.xml.security.stax.ext.stax.XMLSecEvent xmlSecEvent)Returns the XMLEvent type in String formstatic SchemaloadXMLSecuritySchemas()static SecretKeyprepareSecretKey(String symEncAlgo, byte[] rawKey)Convert the raw key bytes into a SecretKey object of type symEncAlgo.
-
-
-
Method Detail
-
dropReferenceMarker
public static String dropReferenceMarker(String reference)
Returns the Id reference without the leading #- Parameters:
reference- The reference on which to drop the #- Returns:
- The reference without a leading #
-
getXMLEventAsString
public static String getXMLEventAsString(org.apache.xml.security.stax.ext.stax.XMLSecEvent xmlSecEvent)
Returns the XMLEvent type in String form- Parameters:
xmlSecEvent-- Returns:
- The XMLEvent type as string representation
-
getTransformer
public static Transformer getTransformer(Transformer transformer, OutputStream outputStream, Map<String,Object> properties, String algorithm, XMLSecurityConstants.DIRECTION direction) throws XMLSecurityException
- Throws:
XMLSecurityException
-
getQNameAttribute
public static String getQNameAttribute(Map<QName,String> attributes, QName qName)
-
createKeyValueTokenStructure
public static void createKeyValueTokenStructure(AbstractOutputProcessor abstractOutputProcessor, OutputProcessorChain outputProcessorChain, X509Certificate[] x509Certificates) throws XMLStreamException, XMLSecurityException
-
createKeyValueTokenStructure
public static void createKeyValueTokenStructure(AbstractOutputProcessor abstractOutputProcessor, OutputProcessorChain outputProcessorChain, PublicKey publicKey) throws XMLStreamException, XMLSecurityException
-
createX509SubjectKeyIdentifierStructure
public static void createX509SubjectKeyIdentifierStructure(AbstractOutputProcessor abstractOutputProcessor, OutputProcessorChain outputProcessorChain, X509Certificate[] x509Certificates) throws XMLSecurityException, XMLStreamException
-
createX509SubjectKeyIdentifierStructure
public static void createX509SubjectKeyIdentifierStructure(AbstractOutputProcessor abstractOutputProcessor, OutputProcessorChain outputProcessorChain, X509Certificate[] x509Certificates, boolean outputX509Data) throws XMLSecurityException, XMLStreamException
-
createX509CertificateStructure
public static void createX509CertificateStructure(AbstractOutputProcessor abstractOutputProcessor, OutputProcessorChain outputProcessorChain, X509Certificate[] x509Certificates) throws XMLSecurityException, XMLStreamException
-
createX509CertificateStructure
public static void createX509CertificateStructure(AbstractOutputProcessor abstractOutputProcessor, OutputProcessorChain outputProcessorChain, X509Certificate[] x509Certificates, boolean outputX509Data) throws XMLSecurityException, XMLStreamException
-
createX509SubjectNameStructure
public static void createX509SubjectNameStructure(AbstractOutputProcessor abstractOutputProcessor, OutputProcessorChain outputProcessorChain, X509Certificate[] x509Certificates) throws XMLSecurityException, XMLStreamException
-
createX509SubjectNameStructure
public static void createX509SubjectNameStructure(AbstractOutputProcessor abstractOutputProcessor, OutputProcessorChain outputProcessorChain, X509Certificate[] x509Certificates, boolean outputX509Data) throws XMLSecurityException, XMLStreamException
-
createX509IssuerSerialStructure
public static void createX509IssuerSerialStructure(AbstractOutputProcessor abstractOutputProcessor, OutputProcessorChain outputProcessorChain, X509Certificate[] x509Certificates) throws XMLStreamException, XMLSecurityException
-
createX509IssuerSerialStructure
public static void createX509IssuerSerialStructure(AbstractOutputProcessor abstractOutputProcessor, OutputProcessorChain outputProcessorChain, X509Certificate[] x509Certificates, boolean outputX509Data) throws XMLStreamException, XMLSecurityException
-
createTokenSecurityEvent
public static org.apache.xml.security.stax.securityEvent.TokenSecurityEvent<? extends org.apache.xml.security.stax.securityToken.InboundSecurityToken> createTokenSecurityEvent(org.apache.xml.security.stax.securityToken.InboundSecurityToken inboundSecurityToken, String correlationID) throws XMLSecurityException- Throws:
XMLSecurityException
-
getExcC14NInclusiveNamespacePrefixes
public static Set<String> getExcC14NInclusiveNamespacePrefixes(org.apache.xml.security.stax.ext.stax.XMLSecStartElement xmlSecStartElement, boolean excludeVisible)
-
copy
public static void copy(InputStream inputStream, OutputStream outputStream) throws IOException
- Throws:
IOException
-
prepareSecretKey
public static SecretKey prepareSecretKey(String symEncAlgo, byte[] rawKey)
Convert the raw key bytes into a SecretKey object of type symEncAlgo.
-
loadXMLSecuritySchemas
public static Schema loadXMLSecuritySchemas() throws SAXException
- Throws:
SAXException
-
createKeyNameTokenStructure
public static void createKeyNameTokenStructure(AbstractOutputProcessor abstractOutputProcessor, OutputProcessorChain outputProcessorChain, String keyName) throws XMLStreamException, XMLSecurityException
-
-