org.bouncycastle.asn1.its.Utils Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of bcutil-jdk14 Show documentation
Show all versions of bcutil-jdk14 Show documentation
The Bouncy Castle Java APIs for ASN.1 extension and utility APIs used to support bcpkix and bctls. This jar contains APIs for JDK 1.4.
package org.bouncycastle.asn1.its;
import org.bouncycastle.util.Arrays;
class Utils
{
/**
*
* OCTET STRING (SIZE(n))
*
*/
static byte[] octetStringFixed(byte[] octets, int n)
{
if (octets.length != n)
{
throw new IllegalArgumentException("octet string out of range");
}
return octets;
}
/**
*
* OCTET STRING (SIZE(1..32))
*
*/
static byte[] octetStringFixed(byte[] octets)
{
if (octets.length < 1 || octets.length > 32)
{
throw new IllegalArgumentException("octet string out of range");
}
return Arrays.clone(octets);
}
}