FileDocCategorySizeDatePackage
UserNotice.javaAPI DocAndroid 1.5 API3099Wed May 06 22:41:06 BST 2009org.bouncycastle.asn1.x509

UserNotice

public class UserNotice extends org.bouncycastle.asn1.ASN1Encodable
UserNotice class, used in CertificatePolicies X509 extensions (in policy qualifiers).
UserNotice ::= SEQUENCE {
noticeRef NoticeReference OPTIONAL,
explicitText DisplayText OPTIONAL}

see
PolicyQualifierId
see
PolicyInformation

Fields Summary
private NoticeReference
noticeRef
private DisplayText
explicitText
Constructors Summary
public UserNotice(NoticeReference noticeRef, DisplayText explicitText)
Creates a new UserNotice instance.

param
noticeRef a NoticeReference value
param
explicitText a DisplayText value

        this.noticeRef = noticeRef;
        this.explicitText = explicitText;
    
public UserNotice(NoticeReference noticeRef, String str)
Creates a new UserNotice instance.

param
noticeRef a NoticeReference value
param
str the explicitText field as a String.

        this.noticeRef = noticeRef;
        this.explicitText = new DisplayText(str);
    
public UserNotice(org.bouncycastle.asn1.ASN1Sequence as)
Creates a new UserNotice instance.

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

param
as an ASN1Sequence value obtained from either calling @{link toASN1Object()} for a UserNotice instance or from parsing it from a DER-encoded stream.

       if (as.size() == 2)
       {
           noticeRef = NoticeReference.getInstance(as.getObjectAt(0));
           explicitText = DisplayText.getInstance(as.getObjectAt(1));
       }
       else if (as.size() == 1)
       {
           if (as.getObjectAt(0).getDERObject() instanceof ASN1Sequence)
           {
               noticeRef = NoticeReference.getInstance(as.getObjectAt(0));
           }
           else
           {
               explicitText = DisplayText.getInstance(as.getObjectAt(0));
           }
       }
       else
       {
           throw new IllegalArgumentException("Bad sequence size: " + as.size());
       }
    
Methods Summary
public DisplayTextgetExplicitText()

        return explicitText;
    
public NoticeReferencegetNoticeRef()

        return noticeRef;
    
public org.bouncycastle.asn1.DERObjecttoASN1Object()

        ASN1EncodableVector av = new ASN1EncodableVector();
      
        if (noticeRef != null)
        {
            av.add(noticeRef);
        }
        
        if (explicitText != null)
        {
            av.add(explicitText);
        }
         
        return new DERSequence(av);