73 lines
2.7 KiB
Java
73 lines
2.7 KiB
Java
|
package org.bouncycastle.asn1.esf;
|
||
|
|
||
|
import java.util.Enumeration;
|
||
|
import org.bouncycastle.asn1.ASN1Encodable;
|
||
|
import org.bouncycastle.asn1.ASN1EncodableVector;
|
||
|
import org.bouncycastle.asn1.ASN1Object;
|
||
|
import org.bouncycastle.asn1.ASN1Primitive;
|
||
|
import org.bouncycastle.asn1.ASN1Sequence;
|
||
|
import org.bouncycastle.asn1.ASN1String;
|
||
|
import org.bouncycastle.asn1.DERSequence;
|
||
|
import org.bouncycastle.asn1.x509.DisplayText;
|
||
|
import org.bouncycastle.asn1.x509.NoticeReference;
|
||
|
|
||
|
/* loaded from: classes6.dex */
|
||
|
public class SPUserNotice extends ASN1Object {
|
||
|
private DisplayText explicitText;
|
||
|
private NoticeReference noticeRef;
|
||
|
|
||
|
@Override // org.bouncycastle.asn1.ASN1Object, org.bouncycastle.asn1.ASN1Encodable
|
||
|
public ASN1Primitive toASN1Primitive() {
|
||
|
ASN1EncodableVector aSN1EncodableVector = new ASN1EncodableVector();
|
||
|
NoticeReference noticeReference = this.noticeRef;
|
||
|
if (noticeReference != null) {
|
||
|
aSN1EncodableVector.add(noticeReference);
|
||
|
}
|
||
|
DisplayText displayText = this.explicitText;
|
||
|
if (displayText != null) {
|
||
|
aSN1EncodableVector.add(displayText);
|
||
|
}
|
||
|
return new DERSequence(aSN1EncodableVector);
|
||
|
}
|
||
|
|
||
|
public NoticeReference getNoticeRef() {
|
||
|
return this.noticeRef;
|
||
|
}
|
||
|
|
||
|
public DisplayText getExplicitText() {
|
||
|
return this.explicitText;
|
||
|
}
|
||
|
|
||
|
public static SPUserNotice getInstance(Object obj) {
|
||
|
if (obj instanceof SPUserNotice) {
|
||
|
return (SPUserNotice) obj;
|
||
|
}
|
||
|
if (obj != null) {
|
||
|
return new SPUserNotice(ASN1Sequence.getInstance(obj));
|
||
|
}
|
||
|
return null;
|
||
|
}
|
||
|
|
||
|
public SPUserNotice(NoticeReference noticeReference, DisplayText displayText) {
|
||
|
this.noticeRef = noticeReference;
|
||
|
this.explicitText = displayText;
|
||
|
}
|
||
|
|
||
|
private SPUserNotice(ASN1Sequence aSN1Sequence) {
|
||
|
Enumeration objects = aSN1Sequence.getObjects();
|
||
|
while (objects.hasMoreElements()) {
|
||
|
ASN1Encodable aSN1Encodable = (ASN1Encodable) objects.nextElement();
|
||
|
if ((aSN1Encodable instanceof DisplayText) || (aSN1Encodable instanceof ASN1String)) {
|
||
|
this.explicitText = DisplayText.getInstance(aSN1Encodable);
|
||
|
} else {
|
||
|
if (!(aSN1Encodable instanceof NoticeReference) && !(aSN1Encodable instanceof ASN1Sequence)) {
|
||
|
StringBuilder sb = new StringBuilder("Invalid element in 'SPUserNotice': ");
|
||
|
sb.append(aSN1Encodable.getClass().getName());
|
||
|
throw new IllegalArgumentException(sb.toString());
|
||
|
}
|
||
|
this.noticeRef = NoticeReference.getInstance(aSN1Encodable);
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|