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

io.gatling.recorder.internal.bouncycastle.asn1.cmp.KemBMParameter Maven / Gradle / Ivy

package io.gatling.recorder.internal.bouncycastle.asn1.cmp;

import io.gatling.recorder.internal.bouncycastle.asn1.ASN1EncodableVector;
import io.gatling.recorder.internal.bouncycastle.asn1.ASN1Integer;
import io.gatling.recorder.internal.bouncycastle.asn1.ASN1Object;
import io.gatling.recorder.internal.bouncycastle.asn1.ASN1Primitive;
import io.gatling.recorder.internal.bouncycastle.asn1.ASN1Sequence;
import io.gatling.recorder.internal.bouncycastle.asn1.DERSequence;
import io.gatling.recorder.internal.bouncycastle.asn1.x509.AlgorithmIdentifier;

/**
 * 
 *  KemBMParameter ::= SEQUENCE {
 *      kdf              AlgorithmIdentifier{KEY-DERIVATION, {...}},
 *      len              INTEGER (1..MAX),
 *      mac              AlgorithmIdentifier{MAC-ALGORITHM, {...}}
 *   }
 * 
*/ public class KemBMParameter extends ASN1Object { private final AlgorithmIdentifier kdf; private final ASN1Integer len; private final AlgorithmIdentifier mac; private KemBMParameter(ASN1Sequence seq) { if (seq.size() != 3) { throw new IllegalArgumentException("sequence size should 3"); } kdf = AlgorithmIdentifier.getInstance(seq.getObjectAt(0)); len = ASN1Integer.getInstance(seq.getObjectAt(1)); mac = AlgorithmIdentifier.getInstance(seq.getObjectAt(2)); } public KemBMParameter( AlgorithmIdentifier kdf, ASN1Integer len, AlgorithmIdentifier mac) { this.kdf = kdf; this.len = len; this.mac = mac; } public KemBMParameter( AlgorithmIdentifier kdf, long len, AlgorithmIdentifier mac) { this(kdf, new ASN1Integer(len), mac); } public static KemBMParameter getInstance(Object o) { if (o instanceof KemBMParameter) { return (KemBMParameter)o; } if (o != null) { return new KemBMParameter(ASN1Sequence.getInstance(o)); } return null; } public AlgorithmIdentifier getKdf() { return kdf; } public ASN1Integer getLen() { return len; } public AlgorithmIdentifier getMac() { return mac; } /** *
     *  KemBMParameter ::= SEQUENCE {
     *      kdf              AlgorithmIdentifier{KEY-DERIVATION, {...}},
     *      len              INTEGER (1..MAX),
     *      mac              AlgorithmIdentifier{MAC-ALGORITHM, {...}}
     *    }
     * 
* * @return a basic ASN.1 object representation. */ public ASN1Primitive toASN1Primitive() { ASN1EncodableVector v = new ASN1EncodableVector(3); v.add(kdf); v.add(len); v.add(mac); return new DERSequence(v); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy