net.ripe.rpki.commons.crypto.util
Class Asn1Util

java.lang.Object
  extended by net.ripe.rpki.commons.crypto.util.Asn1Util

public final class Asn1Util
extends Object


Method Summary
static org.bouncycastle.asn1.ASN1Primitive decode(byte[] extension)
          Decodes the byte array extension using the ASN1InputStream.
static byte[] encode(org.bouncycastle.asn1.ASN1Encodable value)
           
static org.bouncycastle.asn1.DERBitString encodeIpAddress(net.ripe.ipresource.IpRange prefix)
          IPAddress ::= BIT STRING
static
<T extends org.bouncycastle.asn1.ASN1Encodable>
T
expect(org.bouncycastle.asn1.ASN1Encodable value, Class<? extends T> expectedClass)
          Checks if value is an instance of the expectedClass.
static net.ripe.ipresource.Asn parseAsId(org.bouncycastle.asn1.ASN1Encodable der)
          ASId ::= INTEGER
static net.ripe.ipresource.IpAddress parseIpAddress(net.ripe.ipresource.IpResourceType type, org.bouncycastle.asn1.ASN1Encodable der, boolean padWithOnes)
          IPAddress ::= BIT STRING
static net.ripe.ipresource.IpRange parseIpAddressAsPrefix(net.ripe.ipresource.IpResourceType type, org.bouncycastle.asn1.ASN1Encodable der)
          IpAddress used as a prefix.
static org.bouncycastle.asn1.DERBitString resourceToBitString(net.ripe.ipresource.UniqueIpResource resource, int bitCount)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

encode

public static byte[] encode(org.bouncycastle.asn1.ASN1Encodable value)

resourceToBitString

public static org.bouncycastle.asn1.DERBitString resourceToBitString(net.ripe.ipresource.UniqueIpResource resource,
                                                                     int bitCount)

decode

public static org.bouncycastle.asn1.ASN1Primitive decode(byte[] extension)
Decodes the byte array extension using the ASN1InputStream.


expect

public static <T extends org.bouncycastle.asn1.ASN1Encodable> T expect(org.bouncycastle.asn1.ASN1Encodable value,
                                                                       Class<? extends T> expectedClass)
Checks if value is an instance of the expectedClass.

Throws:
IllegalArgumentException - the instance is null or not an instance of the expected class.

parseIpAddressAsPrefix

public static net.ripe.ipresource.IpRange parseIpAddressAsPrefix(net.ripe.ipresource.IpResourceType type,
                                                                 org.bouncycastle.asn1.ASN1Encodable der)
IpAddress used as a prefix.


parseIpAddress

public static net.ripe.ipresource.IpAddress parseIpAddress(net.ripe.ipresource.IpResourceType type,
                                                           org.bouncycastle.asn1.ASN1Encodable der,
                                                           boolean padWithOnes)
IPAddress ::= BIT STRING


parseAsId

public static net.ripe.ipresource.Asn parseAsId(org.bouncycastle.asn1.ASN1Encodable der)
ASId ::= INTEGER


encodeIpAddress

public static org.bouncycastle.asn1.DERBitString encodeIpAddress(net.ripe.ipresource.IpRange prefix)
IPAddress ::= BIT STRING



Copyright © 2008-2014 RIPE NCC, the Netherlands. All Rights Reserved.