Skip navigation links

Oracle Fusion Middleware Crypto Java API Reference for Oracle Security Developer Tools
11g Release 1 (11.1.1)

E10668-05


oracle.security.crypto.asn1
Class ASN1Utils

java.lang.Object
  extended by oracle.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[] xecdsaID
          ANSI X9.62 ECDSA Object Identifier 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 ASN1Object inputASN1Object(byte[] encoding)
           
static ASN1Object inputASN1Object(java.io.InputStream is)
           
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.

xecdsaID

public static final int[] xecdsaID
ANSI X9.62 ECDSA 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).

Skip navigation links

Oracle Fusion Middleware Crypto Java API Reference for Oracle Security Developer Tools
11g Release 1 (11.1.1)

E10668-05


Copyright © 2005, 2013, Oracle. All rights reserved.