Package org.apache.xml.security.stax.ext
Class XMLSecurityUtils
- java.lang.Object
-
- org.apache.xml.security.stax.ext.XMLSecurityUtils
-
public class XMLSecurityUtils extends Object
- Version:
- $Revision: 1764267 $ $Date: 2016-10-11 17:16:49 +0200 (Tue, 11 Oct 2016) $
- Author:
- $Author: coheigea $
-
-
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 TokenSecurityEvent<? extends InboundSecurityToken>createTokenSecurityEvent(InboundSecurityToken inboundSecurityToken, String correlationID)static voidcreateX509CertificateStructure(AbstractOutputProcessor abstractOutputProcessor, OutputProcessorChain outputProcessorChain, X509Certificate[] x509Certificates)static voidcreateX509IssuerSerialStructure(AbstractOutputProcessor abstractOutputProcessor, OutputProcessorChain outputProcessorChain, X509Certificate[] x509Certificates)static voidcreateX509SubjectKeyIdentifierStructure(AbstractOutputProcessor abstractOutputProcessor, OutputProcessorChain outputProcessorChain, X509Certificate[] x509Certificates)static voidcreateX509SubjectNameStructure(AbstractOutputProcessor abstractOutputProcessor, OutputProcessorChain outputProcessorChain, X509Certificate[] x509Certificates)static StringdropReferenceMarker(String reference)Returns the Id reference without the leading #static Set<String>getExcC14NInclusiveNamespacePrefixes(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 <T> TgetType(List<Object> objects, Class<T> clazz)static StringgetXMLEventAsString(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(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
-
createX509CertificateStructure
public static void createX509CertificateStructure(AbstractOutputProcessor abstractOutputProcessor, OutputProcessorChain outputProcessorChain, X509Certificate[] x509Certificates) throws XMLSecurityException, XMLStreamException
-
createX509SubjectNameStructure
public static void createX509SubjectNameStructure(AbstractOutputProcessor abstractOutputProcessor, OutputProcessorChain outputProcessorChain, X509Certificate[] x509Certificates) throws XMLSecurityException, XMLStreamException
-
createX509IssuerSerialStructure
public static void createX509IssuerSerialStructure(AbstractOutputProcessor abstractOutputProcessor, OutputProcessorChain outputProcessorChain, X509Certificate[] x509Certificates) throws XMLStreamException, XMLSecurityException
-
createTokenSecurityEvent
public static TokenSecurityEvent<? extends InboundSecurityToken> createTokenSecurityEvent(InboundSecurityToken inboundSecurityToken, String correlationID) throws XMLSecurityException
- Throws:
XMLSecurityException
-
getExcC14NInclusiveNamespacePrefixes
public static Set<String> getExcC14NInclusiveNamespacePrefixes(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
-
-