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

org.spongycastle.asn1.mozilla.SignedPublicKeyAndChallenge Maven / Gradle / Ivy

Go to download

Spongy Castle is a package-rename (org.bouncycastle.* to org.spongycastle.*) of Bouncy Castle intended for the Android platform. Android unfortunately ships with a stripped-down version of Bouncy Castle, which prevents easy upgrades - Spongy Castle overcomes this and provides a full, up-to-date version of the Bouncy Castle cryptographic libs.

The newest version!
package org.spongycastle.asn1.mozilla;

import org.spongycastle.asn1.ASN1Object;
import org.spongycastle.asn1.ASN1Primitive;
import org.spongycastle.asn1.ASN1Sequence;
import org.spongycastle.asn1.DERBitString;
import org.spongycastle.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