public final class JavaUtils
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static void |
checkRegisterPermission()
Throws a
SecurityException if a security manager is installed
and the caller is not allowed to register an implementation of an
algorithm, transform, or other security sensitive XML Signature function. |
static byte[] |
convertDsaASN1toXMLDSIG(byte[] asn1Bytes,
int size)
Converts an ASN.1 DSA value to a XML Signature DSA Value.
|
static byte[] |
convertDsaXMLDSIGtoASN1(byte[] xmldsigBytes,
int size)
Converts an XML Signature DSA Value to a ASN.1 DSA value.
|
static byte[] |
getBytesFromFile(java.lang.String fileName)
Method getBytesFromFile
|
static byte[] |
getBytesFromStream(java.io.InputStream inputStream)
This method reads all bytes from the given InputStream till EOF and
returns them as a byte array.
|
static void |
writeBytesToFilename(java.lang.String filename,
byte[] bytes)
Method writeBytesToFilename
|
public static byte[] getBytesFromFile(java.lang.String fileName)
throws java.io.FileNotFoundException,
java.io.IOException
fileName - java.io.FileNotFoundExceptionjava.io.IOExceptionpublic static void writeBytesToFilename(java.lang.String filename,
byte[] bytes)
filename - bytes - public static byte[] getBytesFromStream(java.io.InputStream inputStream)
throws java.io.IOException
inputStream - java.io.FileNotFoundExceptionjava.io.IOExceptionpublic static byte[] convertDsaASN1toXMLDSIG(byte[] asn1Bytes,
int size)
throws java.io.IOException
asn1Bytes - the ASN.1 encoded bytessize - size of r and s in bytesjava.io.IOException - if the bytes are not encoded correctlypublic static byte[] convertDsaXMLDSIGtoASN1(byte[] xmldsigBytes,
int size)
throws java.io.IOException
xmldsigBytes - the XML Signature encoded bytessize - size of r and s in bytesjava.io.IOException - if the bytes are not encoded correctlypublic static void checkRegisterPermission()
SecurityException if a security manager is installed
and the caller is not allowed to register an implementation of an
algorithm, transform, or other security sensitive XML Signature function.java.lang.SecurityException - if a security manager is installed and the
caller has not been granted the
"org.docx4j.org.apache.xml.security.register"
SecurityPermissionCopyright © 2007–2023. All rights reserved.