Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/quite/humla-spongycastle.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/main/java/org/bouncycastle/asn1/pkcs/Pfx.java')
-rw-r--r--core/src/main/java/org/bouncycastle/asn1/pkcs/Pfx.java87
1 files changed, 0 insertions, 87 deletions
diff --git a/core/src/main/java/org/bouncycastle/asn1/pkcs/Pfx.java b/core/src/main/java/org/bouncycastle/asn1/pkcs/Pfx.java
deleted file mode 100644
index 7885a795..00000000
--- a/core/src/main/java/org/bouncycastle/asn1/pkcs/Pfx.java
+++ /dev/null
@@ -1,87 +0,0 @@
-package org.bouncycastle.asn1.pkcs;
-
-import java.math.BigInteger;
-
-import org.bouncycastle.asn1.ASN1EncodableVector;
-import org.bouncycastle.asn1.ASN1Integer;
-import org.bouncycastle.asn1.ASN1Object;
-import org.bouncycastle.asn1.ASN1Primitive;
-import org.bouncycastle.asn1.ASN1Sequence;
-import org.bouncycastle.asn1.BERSequence;
-
-/**
- * the infamous Pfx from PKCS12
- */
-public class Pfx
- extends ASN1Object
- implements PKCSObjectIdentifiers
-{
- private ContentInfo contentInfo;
- private MacData macData = null;
-
- private Pfx(
- ASN1Sequence seq)
- {
- BigInteger version = ((ASN1Integer)seq.getObjectAt(0)).getValue();
- if (version.intValue() != 3)
- {
- throw new IllegalArgumentException("wrong version for PFX PDU");
- }
-
- contentInfo = ContentInfo.getInstance(seq.getObjectAt(1));
-
- if (seq.size() == 3)
- {
- macData = MacData.getInstance(seq.getObjectAt(2));
- }
- }
-
- public static Pfx getInstance(
- Object obj)
- {
- if (obj instanceof Pfx)
- {
- return (Pfx)obj;
- }
-
- if (obj != null)
- {
- return new Pfx(ASN1Sequence.getInstance(obj));
- }
-
- return null;
- }
-
- public Pfx(
- ContentInfo contentInfo,
- MacData macData)
- {
- this.contentInfo = contentInfo;
- this.macData = macData;
- }
-
- public ContentInfo getAuthSafe()
- {
- return contentInfo;
- }
-
- public MacData getMacData()
- {
- return macData;
- }
-
- public ASN1Primitive toASN1Primitive()
- {
- ASN1EncodableVector v = new ASN1EncodableVector();
-
- v.add(new ASN1Integer(3));
- v.add(contentInfo);
-
- if (macData != null)
- {
- v.add(macData);
- }
-
- return new BERSequence(v);
- }
-}