![JAR search and dependency download from the Maven repository](/logo.png)
nl.open.jwtdependency.org.bouncycastle.asn1.x509.SubjectKeyIdentifier Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of java-jwt-nodependencies Show documentation
Show all versions of java-jwt-nodependencies Show documentation
This is a drop in replacement for the auth0 java-jwt library (see https://github.com/auth0/java-jwt). This jar makes sure there are no external dependencies (e.g. fasterXml, Apacha Commons) needed. This is useful when deploying to an application server (e.g. tomcat with Alfreso or Pega).
The newest version!
package org.bouncycastle.asn1.x509;
import org.bouncycastle.asn1.ASN1Object;
import org.bouncycastle.asn1.ASN1OctetString;
import org.bouncycastle.asn1.ASN1Primitive;
import org.bouncycastle.asn1.ASN1TaggedObject;
import org.bouncycastle.asn1.DEROctetString;
import org.bouncycastle.util.Arrays;
/**
* The SubjectKeyIdentifier object.
*
* SubjectKeyIdentifier::= OCTET STRING
*
*/
public class SubjectKeyIdentifier
extends ASN1Object
{
private byte[] keyidentifier;
public static SubjectKeyIdentifier getInstance(
ASN1TaggedObject obj,
boolean explicit)
{
return getInstance(ASN1OctetString.getInstance(obj, explicit));
}
public static SubjectKeyIdentifier getInstance(
Object obj)
{
if (obj instanceof SubjectKeyIdentifier)
{
return (SubjectKeyIdentifier)obj;
}
else if (obj != null)
{
return new SubjectKeyIdentifier(ASN1OctetString.getInstance(obj));
}
return null;
}
public static SubjectKeyIdentifier fromExtensions(Extensions extensions)
{
return SubjectKeyIdentifier.getInstance(extensions.getExtensionParsedValue(Extension.subjectKeyIdentifier));
}
public SubjectKeyIdentifier(
byte[] keyid)
{
this.keyidentifier = Arrays.clone(keyid);
}
protected SubjectKeyIdentifier(
ASN1OctetString keyid)
{
this(keyid.getOctets());
}
public byte[] getKeyIdentifier()
{
return Arrays.clone(keyidentifier);
}
public ASN1Primitive toASN1Primitive()
{
return new DEROctetString(getKeyIdentifier());
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy