public final class JavaUtils extends 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(String fileName)
Method getBytesFromFile
|
static byte[] |
getBytesFromStream(InputStream inputStream)
This method reads all bytes from the given InputStream till EOF and
returns them as a byte array.
|
static void |
writeBytesToFilename(String filename,
byte[] bytes)
Method writeBytesToFilename
|
public static byte[] getBytesFromFile(String fileName) throws FileNotFoundException, IOException
fileName
- FileNotFoundException
IOException
public static void writeBytesToFilename(String filename, byte[] bytes)
filename
- bytes
- public static byte[] getBytesFromStream(InputStream inputStream) throws IOException
inputStream
- FileNotFoundException
IOException
public static byte[] convertDsaASN1toXMLDSIG(byte[] asn1Bytes, int size) throws IOException
asn1Bytes
- the ASN.1 encoded bytessize
- size of r and s in bytesIOException
- if the bytes are not encoded correctlypublic static byte[] convertDsaXMLDSIGtoASN1(byte[] xmldsigBytes, int size) throws IOException
xmldsigBytes
- the XML Signature encoded bytessize
- size of r and s in bytesIOException
- 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.SecurityException
- if a security manager is installed and the
caller has not been granted the
"org.apache.xml.security.register"
SecurityPermission
Copyright © 2000–2020 The Apache Software Foundation. All rights reserved.