Example usage for org.bouncycastle.asn1.pkcs Attribute getEncoded

List of usage examples for org.bouncycastle.asn1.pkcs Attribute getEncoded

Introduction

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

Prototype

public byte[] getEncoded() throws IOException 

Source Link

Document

Return the default BER or DER encoding for this object.

Usage

From source file:de.carne.certmgr.store.provider.bouncycastle.BouncyCastlePKCS10Object.java

License:Open Source License

@Override
public byte[][] getAttributeValues(String oid) throws IOException {
    Attribute[] attributes = this.pkcs10Object.getAttributes(new ASN1ObjectIdentifier(oid));
    ArrayList<byte[]> values = null;

    if (attributes != null) {
        values = new ArrayList<>(attributes.length);
        for (Attribute attribute : attributes) {
            values.add(attribute.getEncoded());
        }//from   ww w  .ja v a 2s .c o  m
    }
    return (values != null ? values.toArray(new byte[values.size()][]) : null);
}