All Downloads are FREE. Search and download functionalities are using the official Maven repository.

nl.open.jwtdependency.org.bouncycastle.asn1.mozilla.SignedPublicKeyAndChallenge Maven / Gradle / Ivy

Go to download

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.mozilla;

import org.bouncycastle.asn1.ASN1Object;
import org.bouncycastle.asn1.ASN1Primitive;
import org.bouncycastle.asn1.ASN1Sequence;
import org.bouncycastle.asn1.DERBitString;
import org.bouncycastle.asn1.x509.AlgorithmIdentifier;

/**
 *  
 *  SignedPublicKeyAndChallenge ::= SEQUENCE {
 *    publicKeyAndChallenge PublicKeyAndChallenge,
 *    signatureAlgorithm AlgorithmIdentifier,
 *    signature BIT STRING
 *  }
 *
 *  
*/ public class SignedPublicKeyAndChallenge extends ASN1Object { private final PublicKeyAndChallenge pubKeyAndChal; private final ASN1Sequence pkacSeq; public static SignedPublicKeyAndChallenge getInstance(Object obj) { if (obj instanceof SignedPublicKeyAndChallenge) { return (SignedPublicKeyAndChallenge)obj; } else if (obj != null) { return new SignedPublicKeyAndChallenge(ASN1Sequence.getInstance(obj)); } return null; } private SignedPublicKeyAndChallenge(ASN1Sequence seq) { pkacSeq = seq; pubKeyAndChal = PublicKeyAndChallenge.getInstance(seq.getObjectAt(0)); } public ASN1Primitive toASN1Primitive() { return pkacSeq; } public PublicKeyAndChallenge getPublicKeyAndChallenge() { return pubKeyAndChal; } public AlgorithmIdentifier getSignatureAlgorithm() { return AlgorithmIdentifier.getInstance(pkacSeq.getObjectAt(1)); } public DERBitString getSignature() { return DERBitString.getInstance(pkacSeq.getObjectAt(2)); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy