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

org.bouncycastle.pqc.asn1.FalconPublicKey Maven / Gradle / Ivy

Go to download

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 to JDK 1.8.

There is a newer version: 1.79
Show newest version
package org.bouncycastle.pqc.asn1;


import org.bouncycastle.asn1.*;
import org.bouncycastle.util.Arrays;

/**
 *
 * Classic McEliece Public Key Format.
 * See https://datatracker.ietf.org/doc/draft-uni-qsckeys/ for details.
 * 
 *     FALCONPublicKey := SEQUENCE {
 *         h           OCTET STRING       -- integer polynomial h
 *     }
 * 
*/ public class FalconPublicKey extends ASN1Object { private byte[] h; public FalconPublicKey(byte[] h) { this.h = h; } public byte[] getH() { return h; } public FalconPublicKey(ASN1Sequence seq) { h = Arrays.clone(ASN1OctetString.getInstance(seq.getObjectAt(0)).getOctets()); } public ASN1Primitive toASN1Primitive() { ASN1EncodableVector v = new ASN1EncodableVector(); v.add(new DEROctetString(h)); return new DERSequence(v); } public static FalconPublicKey getInstance(Object o) { if (o instanceof FalconPublicKey) { return (FalconPublicKey) o; } else if (o != null) { return new FalconPublicKey(ASN1Sequence.getInstance(o)); } return null; } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy