Example usage for org.bouncycastle.asn1 ASN1EncodableVector add

List of usage examples for org.bouncycastle.asn1 ASN1EncodableVector add

Introduction

In this page you can find the example usage for org.bouncycastle.asn1 ASN1EncodableVector add.

Prototype

public void add(ASN1Encodable element) 

Source Link

Usage

From source file:com.novosec.pkix.asn1.crmf.AttributeTypeAndValue.java

License:Open Source License

public DERObject getDERObject() {
    ASN1EncodableVector v = new ASN1EncodableVector();

    v.add(type);
    v.add(value);/*from   w w  w .  j  a  v  a2s .co m*/

    return new DERSequence(v);
}

From source file:com.novosec.pkix.asn1.crmf.CertId.java

License:Open Source License

public DERObject getDERObject() {
    ASN1EncodableVector v = new ASN1EncodableVector();

    v.add(issuer);
    v.add(serialNumber);/*from  ww  w.j a v a 2s . c om*/

    return new DERSequence(v);
}

From source file:com.novosec.pkix.asn1.crmf.CertReqMessages.java

License:Open Source License

public DERObject getDERObject() {

    ASN1EncodableVector v = new ASN1EncodableVector();

    for (int i = 0; i < certReqMsgs.size(); i++) {
        v.add((CertReqMsg) certReqMsgs.elementAt(i));
    }//  w  ww. ja v  a 2  s . c  o  m

    return new DERSequence(v);
}

From source file:com.novosec.pkix.asn1.crmf.CertReqMsg.java

License:Open Source License

public DERObject getDERObject() {
    ASN1EncodableVector v = new ASN1EncodableVector();

    v.add(certReq);

    if (pop != null) {
        v.add(pop);/*w  w  w. java  2 s  .  c  om*/
    }

    if (regInfos.size() > 0) {
        ASN1EncodableVector regiv = new ASN1EncodableVector();
        for (int i = 0; i < regInfos.size(); i++) {
            regiv.add((AttributeTypeAndValue) regInfos.elementAt(i));
        }

        v.add(new DERSequence(regiv));
    }

    return new DERSequence(v);
}

From source file:com.novosec.pkix.asn1.crmf.CertRequest.java

License:Open Source License

public DERObject getDERObject() {
    ASN1EncodableVector v = new ASN1EncodableVector();

    v.add(certReqId);
    v.add(certTemplate);//from w ww  .jav a  2  s  . c  o  m

    if (controls.size() > 0) {
        ASN1EncodableVector pubiv = new ASN1EncodableVector();
        for (int i = 0; i < controls.size(); i++) {
            pubiv.add((AttributeTypeAndValue) controls.elementAt(i));
        }

        v.add(new DERSequence(pubiv));
    }

    return new DERSequence(v);
}

From source file:com.novosec.pkix.asn1.crmf.CertTemplate.java

License:Open Source License

public DERObject getDERObject() {
    ASN1EncodableVector v = new ASN1EncodableVector();

    if (version != null) {
        v.add(new DERTaggedObject(false, 0, version));
    }/*from w  ww .j a  va2 s  . c om*/
    if (serialNumber != null) {
        v.add(new DERTaggedObject(false, 1, serialNumber));
    }
    if (signingAlg != null) {
        v.add(new DERTaggedObject(false, 2, signingAlg));
    }
    if (issuer != null) {
        v.add(new DERTaggedObject(bNameIsExplicit, 3, issuer));
    }
    if (validity != null) {
        v.add(new DERTaggedObject(false, 4, validity));
    }
    if (subject != null) {
        v.add(new DERTaggedObject(bNameIsExplicit, 5, subject));
    }
    if (publicKey != null) {
        v.add(new DERTaggedObject(false, 6, publicKey));
    }
    if (issuerUID != null) {
        v.add(new DERTaggedObject(false, 7, issuerUID));
    }
    if (subjectUID != null) {
        v.add(new DERTaggedObject(false, 8, subjectUID));
    }
    if (extensions != null) {
        v.add(new DERTaggedObject(false, 9, extensions));
    }

    return new DERSequence(v);
}

From source file:com.novosec.pkix.asn1.crmf.EncryptedValue.java

License:Open Source License

public DERObject getDERObject() {
    ASN1EncodableVector v = new ASN1EncodableVector();

    if (intendedAlg != null) {
        v.add(new DERTaggedObject(false, 0, intendedAlg));
    }//from w  w  w  .j a va 2  s  .c o  m
    if (symmAlg != null) {
        v.add(new DERTaggedObject(false, 1, symmAlg));
    }
    if (encSymmKey != null) {
        v.add(new DERTaggedObject(false, 2, encSymmKey));
    }
    if (keyAlg != null) {
        v.add(new DERTaggedObject(false, 3, keyAlg));
    }
    if (valueHint != null) {
        v.add(new DERTaggedObject(false, 4, valueHint));
    }

    v.add(encValue);

    return new DERSequence(v);
}

From source file:com.novosec.pkix.asn1.crmf.OptionalValidity.java

License:Open Source License

public DERObject getDERObject() {
    ASN1EncodableVector v = new ASN1EncodableVector();

    if (notBefore != null) {
        v.add(new DERTaggedObject(bTimeIsExplicit, 0, notBefore));
    }//ww w.  j ava 2s  .c o m
    if (notAfter != null) {
        v.add(new DERTaggedObject(bTimeIsExplicit, 1, notAfter));
    }
    return new DERSequence(v);
}

From source file:com.novosec.pkix.asn1.crmf.PBMParameter.java

License:Open Source License

public DERObject getDERObject() {
    ASN1EncodableVector v = new ASN1EncodableVector();

    v.add(salt);
    v.add(owf);//w w w .  ja va 2s .  co  m
    v.add(iterationCount);
    v.add(mac);

    return new DERSequence(v);
}

From source file:com.novosec.pkix.asn1.crmf.PKIPublicationInfo.java

License:Open Source License

public DERObject getDERObject() {
    ASN1EncodableVector v = new ASN1EncodableVector();

    v.add(action);

    if (pubInfos.size() > 0) {
        ASN1EncodableVector pubiv = new ASN1EncodableVector();
        for (int i = 0; i < pubInfos.size(); i++) {
            pubiv.add((SinglePubInfo) pubInfos.elementAt(i));
        }//w w  w .j  a  va 2 s .c o  m
        v.add(new DERSequence(pubiv));
    }

    return new DERSequence(v);
}