74 lines
2.4 KiB
Java
74 lines
2.4 KiB
Java
package org.bouncycastle.asn1.pkcs;
|
|
|
|
import org.bouncycastle.asn1.ASN1Encodable;
|
|
import org.bouncycastle.asn1.ASN1EncodableVector;
|
|
import org.bouncycastle.asn1.ASN1Object;
|
|
import org.bouncycastle.asn1.ASN1ObjectIdentifier;
|
|
import org.bouncycastle.asn1.ASN1Primitive;
|
|
import org.bouncycastle.asn1.ASN1Sequence;
|
|
import org.bouncycastle.asn1.ASN1Set;
|
|
import org.bouncycastle.asn1.ASN1TaggedObject;
|
|
import org.bouncycastle.asn1.DLSequence;
|
|
import org.bouncycastle.asn1.DLTaggedObject;
|
|
|
|
/* loaded from: classes6.dex */
|
|
public class SafeBag extends ASN1Object {
|
|
private ASN1Set bagAttributes;
|
|
private ASN1ObjectIdentifier bagId;
|
|
private ASN1Encodable bagValue;
|
|
|
|
@Override // org.bouncycastle.asn1.ASN1Object, org.bouncycastle.asn1.ASN1Encodable
|
|
public ASN1Primitive toASN1Primitive() {
|
|
ASN1EncodableVector aSN1EncodableVector = new ASN1EncodableVector();
|
|
aSN1EncodableVector.add(this.bagId);
|
|
aSN1EncodableVector.add(new DLTaggedObject(true, 0, this.bagValue));
|
|
ASN1Set aSN1Set = this.bagAttributes;
|
|
if (aSN1Set != null) {
|
|
aSN1EncodableVector.add(aSN1Set);
|
|
}
|
|
return new DLSequence(aSN1EncodableVector);
|
|
}
|
|
|
|
public ASN1Encodable getBagValue() {
|
|
return this.bagValue;
|
|
}
|
|
|
|
public ASN1ObjectIdentifier getBagId() {
|
|
return this.bagId;
|
|
}
|
|
|
|
public ASN1Set getBagAttributes() {
|
|
return this.bagAttributes;
|
|
}
|
|
|
|
public static SafeBag getInstance(Object obj) {
|
|
if (obj instanceof SafeBag) {
|
|
return (SafeBag) obj;
|
|
}
|
|
if (obj != null) {
|
|
return new SafeBag(ASN1Sequence.getInstance(obj));
|
|
}
|
|
return null;
|
|
}
|
|
|
|
private SafeBag(ASN1Sequence aSN1Sequence) {
|
|
this.bagId = (ASN1ObjectIdentifier) aSN1Sequence.getObjectAt(0);
|
|
this.bagValue = ((ASN1TaggedObject) aSN1Sequence.getObjectAt(1)).getObject();
|
|
if (aSN1Sequence.size() == 3) {
|
|
this.bagAttributes = (ASN1Set) aSN1Sequence.getObjectAt(2);
|
|
}
|
|
}
|
|
|
|
public SafeBag(ASN1ObjectIdentifier aSN1ObjectIdentifier, ASN1Encodable aSN1Encodable, ASN1Set aSN1Set) {
|
|
this.bagId = aSN1ObjectIdentifier;
|
|
this.bagValue = aSN1Encodable;
|
|
this.bagAttributes = aSN1Set;
|
|
}
|
|
|
|
public SafeBag(ASN1ObjectIdentifier aSN1ObjectIdentifier, ASN1Encodable aSN1Encodable) {
|
|
this.bagId = aSN1ObjectIdentifier;
|
|
this.bagValue = aSN1Encodable;
|
|
this.bagAttributes = null;
|
|
}
|
|
}
|