what-the-bank/sources/org/bouncycastle/asn1/crmf/EncryptedKey.java

43 lines
1.7 KiB
Java

package org.bouncycastle.asn1.crmf;
import org.bouncycastle.asn1.ASN1Choice;
import org.bouncycastle.asn1.ASN1Encodable;
import org.bouncycastle.asn1.ASN1Object;
import org.bouncycastle.asn1.ASN1Primitive;
import org.bouncycastle.asn1.ASN1TaggedObject;
import org.bouncycastle.asn1.DERTaggedObject;
import org.bouncycastle.asn1.cms.EnvelopedData;
/* loaded from: classes6.dex */
public class EncryptedKey extends ASN1Object implements ASN1Choice {
private EncryptedValue encryptedValue;
private EnvelopedData envelopedData;
@Override // org.bouncycastle.asn1.ASN1Object, org.bouncycastle.asn1.ASN1Encodable
public ASN1Primitive toASN1Primitive() {
EncryptedValue encryptedValue = this.encryptedValue;
return encryptedValue != null ? encryptedValue.toASN1Primitive() : new DERTaggedObject(false, 0, this.envelopedData);
}
public boolean isEncryptedValue() {
return this.encryptedValue != null;
}
public ASN1Encodable getValue() {
EncryptedValue encryptedValue = this.encryptedValue;
return encryptedValue != null ? encryptedValue : this.envelopedData;
}
public static EncryptedKey getInstance(Object obj) {
return obj instanceof EncryptedKey ? (EncryptedKey) obj : obj instanceof ASN1TaggedObject ? new EncryptedKey(EnvelopedData.getInstance((ASN1TaggedObject) obj, false)) : obj instanceof EncryptedValue ? new EncryptedKey((EncryptedValue) obj) : new EncryptedKey(EncryptedValue.getInstance(obj));
}
public EncryptedKey(EncryptedValue encryptedValue) {
this.encryptedValue = encryptedValue;
}
public EncryptedKey(EnvelopedData envelopedData) {
this.envelopedData = envelopedData;
}
}