what-the-bank/sources/org/bouncycastle/asn1/cms/SignerIdentifier.java

59 lines
2.0 KiB
Java
Raw Normal View History

2024-07-27 18:17:47 +07:00
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 SignerIdentifier 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) : aSN1Encodable;
}
public static SignerIdentifier getInstance(Object obj) {
if (obj == null || (obj instanceof SignerIdentifier)) {
return (SignerIdentifier) obj;
}
if (obj instanceof IssuerAndSerialNumber) {
return new SignerIdentifier((IssuerAndSerialNumber) obj);
}
if (obj instanceof ASN1OctetString) {
return new SignerIdentifier((ASN1OctetString) obj);
}
if (obj instanceof ASN1Primitive) {
return new SignerIdentifier((ASN1Primitive) obj);
}
StringBuilder sb = new StringBuilder("Illegal object in SignerIdentifier: ");
sb.append(obj.getClass().getName());
throw new IllegalArgumentException(sb.toString());
}
public SignerIdentifier(IssuerAndSerialNumber issuerAndSerialNumber) {
this.id = issuerAndSerialNumber;
}
public SignerIdentifier(ASN1Primitive aSN1Primitive) {
this.id = aSN1Primitive;
}
public SignerIdentifier(ASN1OctetString aSN1OctetString) {
this.id = new DERTaggedObject(false, 0, aSN1OctetString);
}
}