59 lines
2.1 KiB
Java
59 lines
2.1 KiB
Java
|
package org.bouncycastle.asn1.cms;
|
||
|
|
||
|
import org.bouncycastle.asn1.ASN1Choice;
|
||
|
import org.bouncycastle.asn1.ASN1Encodable;
|
||
|
import org.bouncycastle.asn1.ASN1Object;
|
||
|
import org.bouncycastle.asn1.ASN1OctetString;
|
||
|
import org.bouncycastle.asn1.ASN1Primitive;
|
||
|
import org.bouncycastle.asn1.ASN1TaggedObject;
|
||
|
import org.bouncycastle.asn1.DERTaggedObject;
|
||
|
|
||
|
/* loaded from: classes6.dex */
|
||
|
public class RecipientIdentifier extends ASN1Object implements ASN1Choice {
|
||
|
private ASN1Encodable id;
|
||
|
|
||
|
@Override // org.bouncycastle.asn1.ASN1Object, org.bouncycastle.asn1.ASN1Encodable
|
||
|
public ASN1Primitive toASN1Primitive() {
|
||
|
return this.id.toASN1Primitive();
|
||
|
}
|
||
|
|
||
|
public boolean isTagged() {
|
||
|
return this.id instanceof ASN1TaggedObject;
|
||
|
}
|
||
|
|
||
|
public ASN1Encodable getId() {
|
||
|
ASN1Encodable aSN1Encodable = this.id;
|
||
|
return aSN1Encodable instanceof ASN1TaggedObject ? ASN1OctetString.getInstance((ASN1TaggedObject) aSN1Encodable, false) : IssuerAndSerialNumber.getInstance(aSN1Encodable);
|
||
|
}
|
||
|
|
||
|
public static RecipientIdentifier getInstance(Object obj) {
|
||
|
if (obj == null || (obj instanceof RecipientIdentifier)) {
|
||
|
return (RecipientIdentifier) obj;
|
||
|
}
|
||
|
if (obj instanceof IssuerAndSerialNumber) {
|
||
|
return new RecipientIdentifier((IssuerAndSerialNumber) obj);
|
||
|
}
|
||
|
if (obj instanceof ASN1OctetString) {
|
||
|
return new RecipientIdentifier((ASN1OctetString) obj);
|
||
|
}
|
||
|
if (obj instanceof ASN1Primitive) {
|
||
|
return new RecipientIdentifier((ASN1Primitive) obj);
|
||
|
}
|
||
|
StringBuilder sb = new StringBuilder("Illegal object in RecipientIdentifier: ");
|
||
|
sb.append(obj.getClass().getName());
|
||
|
throw new IllegalArgumentException(sb.toString());
|
||
|
}
|
||
|
|
||
|
public RecipientIdentifier(IssuerAndSerialNumber issuerAndSerialNumber) {
|
||
|
this.id = issuerAndSerialNumber;
|
||
|
}
|
||
|
|
||
|
public RecipientIdentifier(ASN1Primitive aSN1Primitive) {
|
||
|
this.id = aSN1Primitive;
|
||
|
}
|
||
|
|
||
|
public RecipientIdentifier(ASN1OctetString aSN1OctetString) {
|
||
|
this.id = new DERTaggedObject(false, 0, aSN1OctetString);
|
||
|
}
|
||
|
}
|