Example usage for org.bouncycastle.asn1.pkcs CertificationRequestInfo CertificationRequestInfo

List of usage examples for org.bouncycastle.asn1.pkcs CertificationRequestInfo CertificationRequestInfo

Introduction

In this page you can find the example usage for org.bouncycastle.asn1.pkcs CertificationRequestInfo CertificationRequestInfo.

Prototype

public CertificationRequestInfo(ASN1Sequence seq) 

Source Link

Usage

From source file:org.jruby.ext.openssl.PKCS10CertificationRequestExt.java

License:LGPL

public void setAttributes(DERSet attrs) {
    ASN1Sequence seq = (ASN1Sequence) this.reqInfo.toASN1Object();
    ASN1EncodableVector v1 = new ASN1EncodableVector();
    for (int i = 0; i < (seq.size() - 1); i++) {
        v1.add(seq.getObjectAt(i));//from   w  ww.  j  a v  a  2 s.co  m
    }
    v1.add(new DERTaggedObject(0, attrs));
    this.reqInfo = new CertificationRequestInfo(new DERSequence(v1));
}

From source file:org.jruby.ext.openssl.PKCS10CertificationRequestExt.java

License:LGPL

public void setVersion(int v) {
    DERInteger nVersion = new DERInteger(v);
    ASN1Sequence seq = (ASN1Sequence) this.reqInfo.toASN1Object();
    ASN1EncodableVector v1 = new ASN1EncodableVector();
    v1.add(nVersion);//from ww w . j  a  v a  2s. c  o  m
    for (int i = 1; i < seq.size(); i++) {
        v1.add(seq.getObjectAt(i));
    }
    this.reqInfo = new CertificationRequestInfo(new DERSequence(v1));
}