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

org.bouncycastle.asn1.est.CsrAttrs Maven / Gradle / Ivy

Go to download

The Bouncy Castle Java APIs for ASN.1 extension and utility APIs used to support bcpkix and bctls with the BC FIPS provider. The APIs may also be used with other providers although if being used in a FIPS context it is the responsibility of the user to ensure that any other providers used are FIPS certified and used appropriately.

The newest version!
package org.bouncycastle.asn1.est;

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

/**
 * 
 *      CsrAttrs ::= SEQUENCE SIZE (0..MAX) OF AttrOrOID
 * 
*/ public class CsrAttrs extends ASN1Object { private final AttrOrOID[] attrOrOIDs; public static CsrAttrs getInstance( Object obj) { if (obj instanceof CsrAttrs) { return (CsrAttrs)obj; } if (obj != null) { return new CsrAttrs(ASN1Sequence.getInstance(obj)); } return null; } public static CsrAttrs getInstance( ASN1TaggedObject obj, boolean explicit) { return getInstance(ASN1Sequence.getInstance(obj, explicit)); } /** * Construct a CsrAttrs object containing one AttrOrOID. * * @param attrOrOID the AttrOrOID to be contained. */ public CsrAttrs( AttrOrOID attrOrOID) { this.attrOrOIDs = new AttrOrOID[]{attrOrOID}; } public CsrAttrs( AttrOrOID[] attrOrOIDs) { this.attrOrOIDs = Utils.clone(attrOrOIDs); } private CsrAttrs( ASN1Sequence seq) { this.attrOrOIDs = new AttrOrOID[seq.size()]; for (int i = 0; i != seq.size(); i++) { attrOrOIDs[i] = AttrOrOID.getInstance(seq.getObjectAt(i)); } } public AttrOrOID[] getAttrOrOIDs() { return Utils.clone(attrOrOIDs); } public int size() { return attrOrOIDs.length; } public ASN1Primitive toASN1Primitive() { return new DERSequence(attrOrOIDs); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy