Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  package org.bouncycastle.asn1.x509;
  
UserNotice class, used in CertificatePolicies X509 extensions (in policy qualifiers).
 UserNotice ::= SEQUENCE {
      noticeRef        NoticeReference OPTIONAL,
      explicitText     DisplayText OPTIONAL}

 

 
 public class UserNotice 
     extends ASN1Object
 {
     private NoticeReference noticeRef;
     private DisplayText     explicitText;
   
    
Creates a new UserNotice instance.

Parameters:
noticeRef a NoticeReference value
explicitText a DisplayText value
 
     public UserNotice(
         NoticeReference noticeRef
         DisplayText explicitText
     {
         this. = noticeRef;
         this. = explicitText;
     }

    
Creates a new UserNotice instance.

Parameters:
noticeRef a NoticeReference value
str the explicitText field as a String.
 
     public UserNotice(
         NoticeReference noticeRef
         String str
     {
         this(noticeRefnew DisplayText(str));
     }

    
Creates a new UserNotice instance.

Useful from reconstructing a UserNotice instance from its encodable/encoded form.

Parameters:
as an ASN1Sequence value obtained from either calling @{link toASN1Primitive()} for a UserNotice instance or from parsing it from a DER-encoded stream.
 
     private UserNotice(
        ASN1Sequence as
     {
        if (as.size() == 2)
        {
             = NoticeReference.getInstance(as.getObjectAt(0));
             = DisplayText.getInstance(as.getObjectAt(1));
        }
        else if (as.size() == 1)
        {
            if (as.getObjectAt(0).toASN1Primitive() instanceof ASN1Sequence)
            {
                 = NoticeReference.getInstance(as.getObjectAt(0));
            }
            else
            {
                 = DisplayText.getInstance(as.getObjectAt(0));
            }
        }
        else
        {
            throw new IllegalArgumentException("Bad sequence size: " + as.size());
        }
     }
 
     public static UserNotice getInstance(
         Object obj)
     {
         if (obj instanceof UserNotice)
         {
             return (UserNotice)obj;
         }
 
         if (obj != null)
         {
            return new UserNotice(ASN1Sequence.getInstance(obj));
        }
        return null;
    }
    public NoticeReference getNoticeRef()
    {
        return ;
    }
    
    public DisplayText getExplicitText()
    {
        return ;
    }
    
    {
        ASN1EncodableVector av = new ASN1EncodableVector();
      
        if ( != null)
        {
            av.add();
        }
        
        if ( != null)
        {
            av.add();
        }
         
        return new DERSequence(av);
    }
New to GrepCode? Check out our FAQ X