org.bouncycastle.x509.extension.X509ExtensionUtil Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of bcprov-jdk15 Show documentation
Show all versions of bcprov-jdk15 Show documentation
The Bouncy Castle Crypto package is a Java implementation of cryptographic algorithms. This jar contains JCE provider and lightweight API for the Bouncy Castle Cryptography APIs for JDK 1.5.
package org.bouncycastle.x509.extension;
import java.io.IOException;
import org.bouncycastle.asn1.ASN1Encodable;
import org.bouncycastle.asn1.ASN1InputStream;
import org.bouncycastle.asn1.ASN1OctetString;
public class X509ExtensionUtil
{
public static ASN1Encodable fromExtensionValue(
byte[] encodedValue)
throws IOException
{
ASN1InputStream aIn = new ASN1InputStream(encodedValue);
aIn = new ASN1InputStream(((ASN1OctetString)aIn.readObject()).getOctets());
return (ASN1Encodable)aIn.readObject();
}
}