Oracle Security Developer Tools Crypto Java API Reference
10g Release 2 (10.1.2.0.2)

B15565-01


oracle.security.crypto.asn1
Class ASN1Utils

java.lang.Object
  extended byoracle.security.crypto.asn1.ASN1Utils


public class ASN1Utils
extends java.lang.Object

ASN1 auxiliary routines for performing I/O and interconverting ASN.1 format to Java formats.


Field Summary
static int[] attrTypeID
ITU X.520 standard naming attributes arc.
static int[] dds
static int[] entrustID
Entrust OID arc.
static int[] iana
IANA (Internet Assigned Numbers Authority) arc.
static int[] netscapeID
Netscape OID arc.
static int[] nistAlgorithms
NIST (National Institute of Standards and Technology) proposed algorithms arc.
static int[] oiwAlgID
NIST Open Systems Implementation Workshop (OIW) arc.
static int[] phaosID
Phaos OID arc.
static int[] pkcsID
PKCS series arc.
static int[] rsaID
RSA OID arc.
static int[] xcmID
ANSI X9.57 Certificate Management (aka "x9algorithms") arc.
static int[] xkaID
ANSI X9.42 Key Agreement Object Identifier arc.

Method Summary
static ASN1Object addImplicitTag(ASN1Object o, int tag)
Returns the same object but with a different tag (and the context-specific tag class).
static int getTag(int tagOctet)
Returns the tag contained in the given BER tag octet.
static byte[] inputASN1BitString(ASN1Header h, java.io.InputStream is)
Deprecated.
static java.util.Date inputASN1Date(ASN1Header h, java.io.InputStream is)
Deprecated.
static java.math.BigInteger inputASN1Integer(ASN1Header h, java.io.InputStream is)
Deprecated.
static ASN1Object inputASN1Object(byte[] encoding)
static ASN1Object inputASN1Object(java.io.InputStream is)
static int[] inputASN1ObjectID(ASN1Header h, java.io.InputStream is)
Deprecated.
static byte[] inputASN1OctetString(ASN1Header h, java.io.InputStream is)
Deprecated.
static java.lang.String inputASN1String(ASN1Header h, java.io.InputStream is)
Deprecated.
static int inputBase128(java.io.InputStream is)
static boolean isPrefix(int[] a, int[] b)
Return true if a is a prefix of b.
static int lengthBase128(int n)
static int lengthBase256(int n)
static void outputBase128(int n, java.io.OutputStream os)
Outputs an integer in base 128, with as few bytes as possible, most significant byte first, with each byte except the last having its most significant bit set to 1.
static void outputEndOfContents(java.io.OutputStream os)
static void outputHeader(java.io.OutputStream os, int tag, int tagClass)
Outputs a constructed, indefinite-length header.
static void outputLengthBytes(java.io.OutputStream os, int n)
Outputs the length bytes for a definite-length encoding an object of the specified length.
static byte[] toBytesBase128(int n)

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

rsaID

public static final int[] rsaID
RSA OID arc.

netscapeID

public static final int[] netscapeID
Netscape OID arc.

entrustID

public static final int[] entrustID
Entrust OID arc.

phaosID

public static final int[] phaosID
Phaos OID arc.

pkcsID

public static final int[] pkcsID
PKCS series arc.

attrTypeID

public static final int[] attrTypeID
ITU X.520 standard naming attributes arc.

oiwAlgID

public static final int[] oiwAlgID
NIST Open Systems Implementation Workshop (OIW) arc.

xcmID

public static final int[] xcmID
ANSI X9.57 Certificate Management (aka "x9algorithms") arc.

xkaID

public static final int[] xkaID
ANSI X9.42 Key Agreement Object Identifier arc.

iana

public static final int[] iana
IANA (Internet Assigned Numbers Authority) arc.

nistAlgorithms

public static final int[] nistAlgorithms
NIST (National Institute of Standards and Technology) proposed algorithms arc.

dds

public static final int[] dds

Method Detail

inputASN1Object

public static ASN1Object inputASN1Object(java.io.InputStream is)
                                  throws java.io.IOException
Throws:
java.io.IOException

inputASN1Object

public static ASN1Object inputASN1Object(byte[] encoding)
                                  throws java.io.IOException
Throws:
java.io.IOException

outputLengthBytes

public static void outputLengthBytes(java.io.OutputStream os,
                                     int n)
                              throws java.io.IOException
Outputs the length bytes for a definite-length encoding an object of the specified length.
Parameters:
os - the output stream
n - the length (must be nonnegative)
Throws:
java.io.IOException

outputBase128

public static void outputBase128(int n,
                                 java.io.OutputStream os)
                          throws java.io.IOException
Outputs an integer in base 128, with as few bytes as possible, most significant byte first, with each byte except the last having its most significant bit set to 1.

This is used for encoding high tag numbers, and for most of the components of an ASN.1 object identifier.

Parameters:
n - the value to output, which must be nonnegative
os - the output stream
Throws:
java.io.IOException

toBytesBase128

public static byte[] toBytesBase128(int n)

inputBase128

public static int inputBase128(java.io.InputStream is)
                        throws java.io.IOException
Throws:
java.io.IOException

lengthBase128

public static int lengthBase128(int n)

lengthBase256

public static int lengthBase256(int n)

isPrefix

public static boolean isPrefix(int[] a,
                               int[] b)
Return true if a is a prefix of b.

outputHeader

public static void outputHeader(java.io.OutputStream os,
                                int tag,
                                int tagClass)
                         throws java.io.IOException
Outputs a constructed, indefinite-length header.
Throws:
java.io.IOException

outputEndOfContents

public static void outputEndOfContents(java.io.OutputStream os)
                                throws java.io.IOException
Throws:
java.io.IOException

getTag

public static int getTag(int tagOctet)
Returns the tag contained in the given BER tag octet.
Returns:
the tag value, if tag is in the range 0..30, or -1 otherwise.

addImplicitTag

public static ASN1Object addImplicitTag(ASN1Object o,
                                        int tag)
Returns the same object but with a different tag (and the context-specific tag class).

inputASN1String

public static java.lang.String inputASN1String(ASN1Header h,
                                               java.io.InputStream is)
                                        throws java.io.IOException
Deprecated.
Throws:
java.io.IOException

inputASN1Integer

public static java.math.BigInteger inputASN1Integer(ASN1Header h,
                                                    java.io.InputStream is)
                                             throws java.io.IOException
Deprecated.
Throws:
java.io.IOException

inputASN1OctetString

public static byte[] inputASN1OctetString(ASN1Header h,
                                          java.io.InputStream is)
                                   throws java.io.IOException
Deprecated.
Throws:
java.io.IOException

inputASN1BitString

public static byte[] inputASN1BitString(ASN1Header h,
                                        java.io.InputStream is)
                                 throws java.io.IOException
Deprecated.
Throws:
java.io.IOException

inputASN1ObjectID

public static int[] inputASN1ObjectID(ASN1Header h,
                                      java.io.InputStream is)
                               throws java.io.IOException
Deprecated.
Throws:
java.io.IOException

inputASN1Date

public static java.util.Date inputASN1Date(ASN1Header h,
                                           java.io.InputStream is)
                                    throws java.io.IOException
Deprecated.
Throws:
java.io.IOException

Oracle Security Developer Tools Crypto Java API Reference
10g Release 2 (10.1.2.0.2)

B15565-01


Copyright © 2005 , Oracle. All rights reserved.