Example usage for org.bouncycastle.asn1.x509 IetfAttrSyntax VALUE_OCTETS

List of usage examples for org.bouncycastle.asn1.x509 IetfAttrSyntax VALUE_OCTETS

Introduction

In this page you can find the example usage for org.bouncycastle.asn1.x509 IetfAttrSyntax VALUE_OCTETS.

Prototype

int VALUE_OCTETS

To view the source code for org.bouncycastle.asn1.x509 IetfAttrSyntax VALUE_OCTETS.

Click Source Link

Usage

From source file:org.italiangrid.voms.asn1.VOMSACUtils.java

License:Apache License

/**
 * Deserializes the FQANs contained in a {@link IetfAttrSyntax} object
 * //from   www  .j  a  va2 s  .c  o  m
 * @param attr
 *          the {@link IetfAttrSyntax} attribute syntax object containing the
 *          VOMS extension
 * @return a {@link List} of FQANs
 */
private static List<String> deserializeFQANs(IetfAttrSyntax attr) {

    if (attr.getValueType() != IetfAttrSyntax.VALUE_OCTETS)
        raiseACNonConformantError("unsupported attribute values encoding.");

    List<String> fqans = new ArrayList<String>();

    ASN1OctetString[] values = (ASN1OctetString[]) attr.getValues();

    for (ASN1OctetString s : values)
        fqans.add(new String(s.getOctets()));

    return fqans;
}