Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  package org.bouncycastle.asn1.x500;
  
 
 public class RDN
     extends ASN1Object
 {
     private ASN1Set values;
 
     private RDN(ASN1Set values)
     {
         this. = values;
     }
 
     public static RDN getInstance(Object obj)
     {
         if (obj instanceof RDN)
         {
             return (RDN)obj;
         }
         else if (obj != null)
         {
             return new RDN(ASN1Set.getInstance(obj));
         }
 
         return null;
     }

    
Create a single valued RDN.

Parameters:
oid RDN type.
value RDN value.
 
     public RDN(ASN1ObjectIdentifier oidASN1Encodable value)
     {
         ASN1EncodableVector v = new ASN1EncodableVector();
 
         v.add(oid);
         v.add(value);
 
         this. = new DERSet(new DERSequence(v));
     }
 
     public RDN(AttributeTypeAndValue attrTAndV)
     {
         this. = new DERSet(attrTAndV);
     }

    
Create a multi-valued RDN.

Parameters:
aAndVs attribute type/value pairs making up the RDN
 
     public RDN(AttributeTypeAndValue[] aAndVs)
     {
         this. = new DERSet(aAndVs);
     }
 
     public boolean isMultiValued()
     {
         return this..size() > 1;
     }

    
Return the number of AttributeTypeAndValue objects in this RDN,

Returns:
size of RDN, greater than 1 if multi-valued.
 
     public int size()
     {
         return this..size();
     }
 
     public AttributeTypeAndValue getFirst()
     {
         if (this..size() == 0)
         {
             return null;
         }
 
         return AttributeTypeAndValue.getInstance(this..getObjectAt(0));
     }
 
     {
         AttributeTypeAndValue[] tmp = new AttributeTypeAndValue[.size()];
 
         for (int i = 0; i != tmp.lengthi++)
         {
             tmp[i] = AttributeTypeAndValue.getInstance(.getObjectAt(i));
         }
        return tmp;
    }

    
 RelativeDistinguishedName ::=
                     SET OF AttributeTypeAndValue

 AttributeTypeAndValue ::= SEQUENCE {
        type     AttributeType,
        value    AttributeValue }
 

Returns:
this object as an ASN1Primitive type
    {
        return ;
    }
New to GrepCode? Check out our FAQ X