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

org.bouncycastle.oer.its.SignedDataPayload Maven / Gradle / Ivy

Go to download

The Bouncy Castle Java APIs for ASN.1 extension and utility APIs used to support bcpkix and bctls. This jar contains APIs for JDK 1.5 and up.

The newest version!
package org.bouncycastle.oer.its;

import org.bouncycastle.asn1.ASN1EncodableVector;
import org.bouncycastle.asn1.ASN1Object;
import org.bouncycastle.asn1.ASN1Primitive;
import org.bouncycastle.asn1.ASN1Sequence;
import org.bouncycastle.asn1.DERSequence;


/**
 * 
 *     SignedDataPayload ::= SEQUENCE {
 *         data Ieee1609Dot2Data OPTIONAL,
 *         extDataHash HashedData OPTIONAL,
 *         ...
 *     }
 * 
*/ public class SignedDataPayload extends ASN1Object { private final Ieee1609Dot2Data data; private final HashedData extDataHash; public SignedDataPayload(Ieee1609Dot2Data data, HashedData extDataHash) { this.data = data; this.extDataHash = extDataHash; } public static SignedDataPayload getInstance(Object o) { if (o instanceof SignedDataPayload) { return (SignedDataPayload)o; } ASN1Sequence seq = ASN1Sequence.getInstance(o); return new SignedDataPayload(Ieee1609Dot2Data.getInstance(seq.getObjectAt(0)), HashedData.getInstance(seq.getObjectAt(1))); } public static Builder builder() { return new Builder(); } public ASN1Primitive toASN1Primitive() { ASN1EncodableVector v = new ASN1EncodableVector(); return new DERSequence(v); } public Ieee1609Dot2Data getData() { return data; } public HashedData getExtDataHash() { return extDataHash; } public static class Builder { private Ieee1609Dot2Data data; private HashedData extDataHash; public Builder setData(Ieee1609Dot2Data data) { this.data = data; return this; } public Builder setExtDataHash(HashedData extDataHash) { this.extDataHash = extDataHash; return this; } public SignedDataPayload build() { return new SignedDataPayload(data, extDataHash); } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy