mirror of
https://github.com/Kunzisoft/KeePassDX.git
synced 2026-11-26 03:46:46 -08:00
Trim bouncycastle.
This commit is contained in:
1 parent
0da2f8c6e2
commit
e024597b0e
23 files changed
+7
-1707
No files matched your search
@@ -1,45 +0,0 @@
|
||||
package org.bouncycastle.asn1.cryptopro;
|
||||
|
||||
import org.bouncycastle.asn1.DERObjectIdentifier;
|
||||
|
||||
public interface CryptoProObjectIdentifiers
|
||||
{
|
||||
// GOST Algorithms OBJECT IDENTIFIERS :
|
||||
// { iso(1) member-body(2) ru(643) rans(2) cryptopro(2)}
|
||||
static final String GOST_id = "1.2.643.2.2";
|
||||
|
||||
static final DERObjectIdentifier gostR3411 = new DERObjectIdentifier(GOST_id+".9");
|
||||
|
||||
static final DERObjectIdentifier gostR28147_cbc = new DERObjectIdentifier(GOST_id+".21");
|
||||
|
||||
static final DERObjectIdentifier gostR3410_94 = new DERObjectIdentifier(GOST_id+".20");
|
||||
static final DERObjectIdentifier gostR3410_2001 = new DERObjectIdentifier(GOST_id+".19");
|
||||
static final DERObjectIdentifier gostR3411_94_with_gostR3410_94 = new DERObjectIdentifier(GOST_id+".4");
|
||||
static final DERObjectIdentifier gostR3411_94_with_gostR3410_2001 = new DERObjectIdentifier(GOST_id+".3");
|
||||
|
||||
// { iso(1) member-body(2) ru(643) rans(2) cryptopro(2) hashes(30) }
|
||||
static final DERObjectIdentifier gostR3411_94_CryptoProParamSet = new DERObjectIdentifier(GOST_id+".30.1");
|
||||
|
||||
// { iso(1) member-body(2) ru(643) rans(2) cryptopro(2) signs(32) }
|
||||
static final DERObjectIdentifier gostR3410_94_CryptoPro_A = new DERObjectIdentifier(GOST_id+".32.2");
|
||||
static final DERObjectIdentifier gostR3410_94_CryptoPro_B = new DERObjectIdentifier(GOST_id+".32.3");
|
||||
static final DERObjectIdentifier gostR3410_94_CryptoPro_C = new DERObjectIdentifier(GOST_id+".32.4");
|
||||
static final DERObjectIdentifier gostR3410_94_CryptoPro_D = new DERObjectIdentifier(GOST_id+".32.5");
|
||||
|
||||
// { iso(1) member-body(2) ru(643) rans(2) cryptopro(2) exchanges(33) }
|
||||
static final DERObjectIdentifier gostR3410_94_CryptoPro_XchA = new DERObjectIdentifier(GOST_id+".33.1");
|
||||
static final DERObjectIdentifier gostR3410_94_CryptoPro_XchB = new DERObjectIdentifier(GOST_id+".33.2");
|
||||
static final DERObjectIdentifier gostR3410_94_CryptoPro_XchC = new DERObjectIdentifier(GOST_id+".33.3");
|
||||
|
||||
//{ iso(1) member-body(2)ru(643) rans(2) cryptopro(2) ecc-signs(35) }
|
||||
static final DERObjectIdentifier gostR3410_2001_CryptoPro_A = new DERObjectIdentifier(GOST_id+".35.1");
|
||||
static final DERObjectIdentifier gostR3410_2001_CryptoPro_B = new DERObjectIdentifier(GOST_id+".35.2");
|
||||
static final DERObjectIdentifier gostR3410_2001_CryptoPro_C = new DERObjectIdentifier(GOST_id+".35.3");
|
||||
|
||||
// { iso(1) member-body(2) ru(643) rans(2) cryptopro(2) ecc-exchanges(36) }
|
||||
static final DERObjectIdentifier gostR3410_2001_CryptoPro_XchA = new DERObjectIdentifier(GOST_id+".36.0");
|
||||
static final DERObjectIdentifier gostR3410_2001_CryptoPro_XchB = new DERObjectIdentifier(GOST_id+".36.1");
|
||||
|
||||
static final DERObjectIdentifier gost_ElSgDH3410_default = new DERObjectIdentifier(GOST_id+".36.0");
|
||||
static final DERObjectIdentifier gost_ElSgDH3410_1 = new DERObjectIdentifier(GOST_id+".36.1");
|
||||
}
|
||||
@@ -1,100 +0,0 @@
|
||||
package org.bouncycastle.asn1.cryptopro;
|
||||
|
||||
import java.math.BigInteger;
|
||||
import java.util.Enumeration;
|
||||
|
||||
import org.bouncycastle.asn1.ASN1Encodable;
|
||||
import org.bouncycastle.asn1.ASN1EncodableVector;
|
||||
import org.bouncycastle.asn1.ASN1Sequence;
|
||||
import org.bouncycastle.asn1.ASN1TaggedObject;
|
||||
import org.bouncycastle.asn1.DERInteger;
|
||||
import org.bouncycastle.asn1.DERObject;
|
||||
import org.bouncycastle.asn1.DERSequence;
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public class ECGOST3410ParamSetParameters
|
||||
extends ASN1Encodable
|
||||
{
|
||||
DERInteger p, q, a, b, x, y;
|
||||
|
||||
public static ECGOST3410ParamSetParameters getInstance(
|
||||
ASN1TaggedObject obj,
|
||||
boolean explicit)
|
||||
{
|
||||
return getInstance(ASN1Sequence.getInstance(obj, explicit));
|
||||
}
|
||||
|
||||
public static ECGOST3410ParamSetParameters getInstance(
|
||||
Object obj)
|
||||
{
|
||||
if(obj == null || obj instanceof ECGOST3410ParamSetParameters)
|
||||
{
|
||||
return (ECGOST3410ParamSetParameters)obj;
|
||||
}
|
||||
|
||||
if(obj instanceof ASN1Sequence)
|
||||
{
|
||||
return new ECGOST3410ParamSetParameters((ASN1Sequence)obj);
|
||||
}
|
||||
|
||||
throw new IllegalArgumentException("Invalid GOST3410Parameter: " + obj.getClass().getName());
|
||||
}
|
||||
|
||||
public ECGOST3410ParamSetParameters(
|
||||
BigInteger a,
|
||||
BigInteger b,
|
||||
BigInteger p,
|
||||
BigInteger q,
|
||||
int x,
|
||||
BigInteger y)
|
||||
{
|
||||
this.a = new DERInteger(a);
|
||||
this.b = new DERInteger(b);
|
||||
this.p = new DERInteger(p);
|
||||
this.q = new DERInteger(q);
|
||||
this.x = new DERInteger(x);
|
||||
this.y = new DERInteger(y);
|
||||
}
|
||||
|
||||
public ECGOST3410ParamSetParameters(
|
||||
ASN1Sequence seq)
|
||||
{
|
||||
Enumeration e = seq.getObjects();
|
||||
|
||||
a = (DERInteger)e.nextElement();
|
||||
b = (DERInteger)e.nextElement();
|
||||
p = (DERInteger)e.nextElement();
|
||||
q = (DERInteger)e.nextElement();
|
||||
x = (DERInteger)e.nextElement();
|
||||
y = (DERInteger)e.nextElement();
|
||||
}
|
||||
|
||||
public BigInteger getP()
|
||||
{
|
||||
return p.getPositiveValue();
|
||||
}
|
||||
|
||||
public BigInteger getQ()
|
||||
{
|
||||
return q.getPositiveValue();
|
||||
}
|
||||
|
||||
public BigInteger getA()
|
||||
{
|
||||
return a.getPositiveValue();
|
||||
}
|
||||
|
||||
public DERObject toASN1Object()
|
||||
{
|
||||
ASN1EncodableVector v = new ASN1EncodableVector();
|
||||
|
||||
v.add(a);
|
||||
v.add(b);
|
||||
v.add(p);
|
||||
v.add(q);
|
||||
v.add(x);
|
||||
v.add(y);
|
||||
|
||||
return new DERSequence(v);
|
||||
}
|
||||
}
|
||||
@@ -1,73 +0,0 @@
|
||||
package org.bouncycastle.asn1.cryptopro;
|
||||
|
||||
import java.util.Enumeration;
|
||||
|
||||
import org.bouncycastle.asn1.ASN1Encodable;
|
||||
import org.bouncycastle.asn1.ASN1EncodableVector;
|
||||
import org.bouncycastle.asn1.ASN1OctetString;
|
||||
import org.bouncycastle.asn1.ASN1Sequence;
|
||||
import org.bouncycastle.asn1.ASN1TaggedObject;
|
||||
import org.bouncycastle.asn1.DERObject;
|
||||
import org.bouncycastle.asn1.DERObjectIdentifier;
|
||||
import org.bouncycastle.asn1.DERSequence;
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public class GOST28147Parameters
|
||||
extends ASN1Encodable
|
||||
{
|
||||
ASN1OctetString iv;
|
||||
DERObjectIdentifier paramSet;
|
||||
|
||||
public static GOST28147Parameters getInstance(
|
||||
ASN1TaggedObject obj,
|
||||
boolean explicit)
|
||||
{
|
||||
return getInstance(ASN1Sequence.getInstance(obj, explicit));
|
||||
}
|
||||
|
||||
public static GOST28147Parameters getInstance(
|
||||
Object obj)
|
||||
{
|
||||
if(obj == null || obj instanceof GOST28147Parameters)
|
||||
{
|
||||
return (GOST28147Parameters)obj;
|
||||
}
|
||||
|
||||
if(obj instanceof ASN1Sequence)
|
||||
{
|
||||
return new GOST28147Parameters((ASN1Sequence)obj);
|
||||
}
|
||||
|
||||
throw new IllegalArgumentException("Invalid GOST3410Parameter: " + obj.getClass().getName());
|
||||
}
|
||||
|
||||
public GOST28147Parameters(
|
||||
ASN1Sequence seq)
|
||||
{
|
||||
Enumeration e = seq.getObjects();
|
||||
|
||||
iv = (ASN1OctetString)e.nextElement();
|
||||
paramSet = (DERObjectIdentifier)e.nextElement();
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Gost28147-89-Parameters ::=
|
||||
* SEQUENCE {
|
||||
* iv Gost28147-89-IV,
|
||||
* encryptionParamSet OBJECT IDENTIFIER
|
||||
* }
|
||||
*
|
||||
* Gost28147-89-IV ::= OCTET STRING (SIZE (8))
|
||||
* </pre>
|
||||
*/
|
||||
public DERObject toASN1Object()
|
||||
{
|
||||
ASN1EncodableVector v = new ASN1EncodableVector();
|
||||
|
||||
v.add(iv);
|
||||
v.add(paramSet);
|
||||
|
||||
return new DERSequence(v);
|
||||
}
|
||||
}
|
||||
@@ -1,117 +0,0 @@
|
||||
package org.bouncycastle.asn1.cryptopro;
|
||||
|
||||
import java.math.BigInteger;
|
||||
import java.util.Enumeration;
|
||||
import java.util.Hashtable;
|
||||
|
||||
import org.bouncycastle.asn1.DERObjectIdentifier;
|
||||
|
||||
/**
|
||||
* table of the available named parameters for GOST 3410-94.
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public class GOST3410NamedParameters
|
||||
{
|
||||
static final Hashtable objIds = new Hashtable();
|
||||
static final Hashtable params = new Hashtable();
|
||||
static final Hashtable names = new Hashtable();
|
||||
|
||||
static private GOST3410ParamSetParameters cryptoProA = new GOST3410ParamSetParameters(
|
||||
1024,
|
||||
new BigInteger("127021248288932417465907042777176443525787653508916535812817507265705031260985098497423188333483401180925999995120988934130659205614996724254121049274349357074920312769561451689224110579311248812610229678534638401693520013288995000362260684222750813532307004517341633685004541062586971416883686778842537820383"),
|
||||
new BigInteger("68363196144955700784444165611827252895102170888761442055095051287550314083023"),
|
||||
new BigInteger("100997906755055304772081815535925224869841082572053457874823515875577147990529272777244152852699298796483356699682842027972896052747173175480590485607134746852141928680912561502802222185647539190902656116367847270145019066794290930185446216399730872221732889830323194097355403213400972588322876850946740663962")
|
||||
// validationAlgorithm {
|
||||
// algorithm
|
||||
// id-GostR3410-94-bBis,
|
||||
// parameters
|
||||
// GostR3410-94-ValidationBisParameters: {
|
||||
// x0 1376285941,
|
||||
// c 3996757427
|
||||
// }
|
||||
// }
|
||||
|
||||
);
|
||||
|
||||
static private GOST3410ParamSetParameters cryptoProB = new GOST3410ParamSetParameters(
|
||||
1024,
|
||||
new BigInteger("139454871199115825601409655107690713107041707059928031797758001454375765357722984094124368522288239833039114681648076688236921220737322672160740747771700911134550432053804647694904686120113087816240740184800477047157336662926249423571248823968542221753660143391485680840520336859458494803187341288580489525163"),
|
||||
new BigInteger("79885141663410976897627118935756323747307951916507639758300472692338873533959"),
|
||||
new BigInteger("42941826148615804143873447737955502392672345968607143066798112994089471231420027060385216699563848719957657284814898909770759462613437669456364882730370838934791080835932647976778601915343474400961034231316672578686920482194932878633360203384797092684342247621055760235016132614780652761028509445403338652341")
|
||||
// validationAlgorithm {
|
||||
// algorithm
|
||||
// id-GostR3410-94-bBis,
|
||||
// parameters
|
||||
// GostR3410-94-ValidationBisParameters: {
|
||||
// x0 1536654555,
|
||||
// c 1855361757,
|
||||
// d 14408629386140014567655
|
||||
//4902939282056547857802241461782996702017713059974755104394739915140
|
||||
//6115284791024439062735788342744854120601660303926203867703556828005
|
||||
//8957203818114895398976594425537561271800850306
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
);
|
||||
|
||||
static private GOST3410ParamSetParameters cryptoProXchA = new GOST3410ParamSetParameters(
|
||||
1024,
|
||||
new BigInteger("142011741597563481196368286022318089743276138395243738762872573441927459393512718973631166078467600360848946623567625795282774719212241929071046134208380636394084512691828894000571524625445295769349356752728956831541775441763139384457191755096847107846595662547942312293338483924514339614727760681880609734239"),
|
||||
new BigInteger("91771529896554605945588149018382750217296858393520724172743325725474374979801"),
|
||||
new BigInteger("133531813272720673433859519948319001217942375967847486899482359599369642528734712461590403327731821410328012529253871914788598993103310567744136196364803064721377826656898686468463277710150809401182608770201615324990468332931294920912776241137878030224355746606283971659376426832674269780880061631528163475887")
|
||||
);
|
||||
|
||||
static
|
||||
{
|
||||
params.put(CryptoProObjectIdentifiers.gostR3410_94_CryptoPro_A, cryptoProA);
|
||||
params.put(CryptoProObjectIdentifiers.gostR3410_94_CryptoPro_B, cryptoProB);
|
||||
// params.put(CryptoProObjectIdentifiers.gostR3410_94_CryptoPro_C, cryptoProC);
|
||||
// params.put(CryptoProObjectIdentifiers.gostR3410_94_CryptoPro_D, cryptoProD);
|
||||
params.put(CryptoProObjectIdentifiers.gostR3410_94_CryptoPro_XchA, cryptoProXchA);
|
||||
// params.put(CryptoProObjectIdentifiers.gostR3410_94_CryptoPro_XchB, cryptoProXchA);
|
||||
// params.put(CryptoProObjectIdentifiers.gostR3410_94_CryptoPro_XchC, cryptoProXchA);
|
||||
|
||||
objIds.put("GostR3410-94-CryptoPro-A", CryptoProObjectIdentifiers.gostR3410_94_CryptoPro_A);
|
||||
objIds.put("GostR3410-94-CryptoPro-B", CryptoProObjectIdentifiers.gostR3410_94_CryptoPro_B);
|
||||
objIds.put("GostR3410-94-CryptoPro-XchA", CryptoProObjectIdentifiers.gostR3410_94_CryptoPro_XchA);
|
||||
}
|
||||
|
||||
/**
|
||||
* return the GOST3410ParamSetParameters object for the given OID, null if it
|
||||
* isn't present.
|
||||
*
|
||||
* @param oid an object identifier representing a named parameters, if present.
|
||||
*/
|
||||
public static GOST3410ParamSetParameters getByOID(
|
||||
DERObjectIdentifier oid)
|
||||
{
|
||||
return (GOST3410ParamSetParameters)params.get(oid);
|
||||
}
|
||||
|
||||
/**
|
||||
* returns an enumeration containing the name strings for parameters
|
||||
* contained in this structure.
|
||||
*/
|
||||
public static Enumeration getNames()
|
||||
{
|
||||
return objIds.keys();
|
||||
}
|
||||
|
||||
public static GOST3410ParamSetParameters getByName(
|
||||
String name)
|
||||
{
|
||||
DERObjectIdentifier oid = (DERObjectIdentifier)objIds.get(name);
|
||||
|
||||
if (oid != null)
|
||||
{
|
||||
return (GOST3410ParamSetParameters)params.get(oid);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public static DERObjectIdentifier getOID(String name)
|
||||
{
|
||||
return (DERObjectIdentifier)objIds.get(name);
|
||||
}
|
||||
}
|
||||
@@ -1,106 +0,0 @@
|
||||
package org.bouncycastle.asn1.cryptopro;
|
||||
|
||||
import java.math.BigInteger;
|
||||
import java.util.Enumeration;
|
||||
|
||||
import org.bouncycastle.asn1.ASN1Encodable;
|
||||
import org.bouncycastle.asn1.ASN1EncodableVector;
|
||||
import org.bouncycastle.asn1.ASN1Sequence;
|
||||
import org.bouncycastle.asn1.ASN1TaggedObject;
|
||||
import org.bouncycastle.asn1.DERInteger;
|
||||
import org.bouncycastle.asn1.DERObject;
|
||||
import org.bouncycastle.asn1.DERSequence;
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public class GOST3410ParamSetParameters
|
||||
extends ASN1Encodable
|
||||
{
|
||||
int keySize;
|
||||
DERInteger p, q, a;
|
||||
|
||||
public static GOST3410ParamSetParameters getInstance(
|
||||
ASN1TaggedObject obj,
|
||||
boolean explicit)
|
||||
{
|
||||
return getInstance(ASN1Sequence.getInstance(obj, explicit));
|
||||
}
|
||||
|
||||
public static GOST3410ParamSetParameters getInstance(
|
||||
Object obj)
|
||||
{
|
||||
if(obj == null || obj instanceof GOST3410ParamSetParameters)
|
||||
{
|
||||
return (GOST3410ParamSetParameters)obj;
|
||||
}
|
||||
|
||||
if(obj instanceof ASN1Sequence)
|
||||
{
|
||||
return new GOST3410ParamSetParameters((ASN1Sequence)obj);
|
||||
}
|
||||
|
||||
throw new IllegalArgumentException("Invalid GOST3410Parameter: " + obj.getClass().getName());
|
||||
}
|
||||
|
||||
public GOST3410ParamSetParameters(
|
||||
int keySize,
|
||||
BigInteger p,
|
||||
BigInteger q,
|
||||
BigInteger a)
|
||||
{
|
||||
this.keySize = keySize;
|
||||
this.p = new DERInteger(p);
|
||||
this.q = new DERInteger(q);
|
||||
this.a = new DERInteger(a);
|
||||
}
|
||||
|
||||
public GOST3410ParamSetParameters(
|
||||
ASN1Sequence seq)
|
||||
{
|
||||
Enumeration e = seq.getObjects();
|
||||
|
||||
keySize = ((DERInteger)e.nextElement()).getValue().intValue();
|
||||
p = (DERInteger)e.nextElement();
|
||||
q = (DERInteger)e.nextElement();
|
||||
a = (DERInteger)e.nextElement();
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated use getKeySize
|
||||
*/
|
||||
public int getLKeySize()
|
||||
{
|
||||
return keySize;
|
||||
}
|
||||
|
||||
public int getKeySize()
|
||||
{
|
||||
return keySize;
|
||||
}
|
||||
|
||||
public BigInteger getP()
|
||||
{
|
||||
return p.getPositiveValue();
|
||||
}
|
||||
|
||||
public BigInteger getQ()
|
||||
{
|
||||
return q.getPositiveValue();
|
||||
}
|
||||
|
||||
public BigInteger getA()
|
||||
{
|
||||
return a.getPositiveValue();
|
||||
}
|
||||
|
||||
public DERObject toASN1Object()
|
||||
{
|
||||
ASN1EncodableVector v = new ASN1EncodableVector();
|
||||
|
||||
v.add(new DERInteger(keySize));
|
||||
v.add(p);
|
||||
v.add(q);
|
||||
v.add(a);
|
||||
|
||||
return new DERSequence(v);
|
||||
}
|
||||
}
|
||||
@@ -1,101 +0,0 @@
|
||||
package org.bouncycastle.asn1.cryptopro;
|
||||
|
||||
import org.bouncycastle.asn1.ASN1Encodable;
|
||||
import org.bouncycastle.asn1.ASN1EncodableVector;
|
||||
import org.bouncycastle.asn1.ASN1Sequence;
|
||||
import org.bouncycastle.asn1.ASN1TaggedObject;
|
||||
import org.bouncycastle.asn1.DERObject;
|
||||
import org.bouncycastle.asn1.DERObjectIdentifier;
|
||||
import org.bouncycastle.asn1.DERSequence;
|
||||
|
||||
public class GOST3410PublicKeyAlgParameters
|
||||
extends ASN1Encodable
|
||||
{
|
||||
private DERObjectIdentifier publicKeyParamSet;
|
||||
private DERObjectIdentifier digestParamSet;
|
||||
private DERObjectIdentifier encryptionParamSet;
|
||||
|
||||
public static GOST3410PublicKeyAlgParameters getInstance(
|
||||
ASN1TaggedObject obj,
|
||||
boolean explicit)
|
||||
{
|
||||
return getInstance(ASN1Sequence.getInstance(obj, explicit));
|
||||
}
|
||||
|
||||
public static GOST3410PublicKeyAlgParameters getInstance(
|
||||
Object obj)
|
||||
{
|
||||
if(obj == null || obj instanceof GOST3410PublicKeyAlgParameters)
|
||||
{
|
||||
return (GOST3410PublicKeyAlgParameters)obj;
|
||||
}
|
||||
|
||||
if(obj instanceof ASN1Sequence)
|
||||
{
|
||||
return new GOST3410PublicKeyAlgParameters((ASN1Sequence)obj);
|
||||
}
|
||||
|
||||
throw new IllegalArgumentException("Invalid GOST3410Parameter: " + obj.getClass().getName());
|
||||
}
|
||||
|
||||
public GOST3410PublicKeyAlgParameters(
|
||||
DERObjectIdentifier publicKeyParamSet,
|
||||
DERObjectIdentifier digestParamSet)
|
||||
{
|
||||
this.publicKeyParamSet = publicKeyParamSet;
|
||||
this.digestParamSet = digestParamSet;
|
||||
this.encryptionParamSet = null;
|
||||
}
|
||||
|
||||
public GOST3410PublicKeyAlgParameters(
|
||||
DERObjectIdentifier publicKeyParamSet,
|
||||
DERObjectIdentifier digestParamSet,
|
||||
DERObjectIdentifier encryptionParamSet)
|
||||
{
|
||||
this.publicKeyParamSet = publicKeyParamSet;
|
||||
this.digestParamSet = digestParamSet;
|
||||
this.encryptionParamSet = encryptionParamSet;
|
||||
}
|
||||
|
||||
public GOST3410PublicKeyAlgParameters(
|
||||
ASN1Sequence seq)
|
||||
{
|
||||
this.publicKeyParamSet = (DERObjectIdentifier)seq.getObjectAt(0);
|
||||
this.digestParamSet = (DERObjectIdentifier)seq.getObjectAt(1);
|
||||
|
||||
if (seq.size() > 2)
|
||||
{
|
||||
this.encryptionParamSet = (DERObjectIdentifier)seq.getObjectAt(2);
|
||||
}
|
||||
}
|
||||
|
||||
public DERObjectIdentifier getPublicKeyParamSet()
|
||||
{
|
||||
return publicKeyParamSet;
|
||||
}
|
||||
|
||||
public DERObjectIdentifier getDigestParamSet()
|
||||
{
|
||||
return digestParamSet;
|
||||
}
|
||||
|
||||
public DERObjectIdentifier getEncryptionParamSet()
|
||||
{
|
||||
return encryptionParamSet;
|
||||
}
|
||||
|
||||
public DERObject toASN1Object()
|
||||
{
|
||||
ASN1EncodableVector v = new ASN1EncodableVector();
|
||||
|
||||
v.add(publicKeyParamSet);
|
||||
v.add(digestParamSet);
|
||||
|
||||
if (encryptionParamSet != null)
|
||||
{
|
||||
v.add(encryptionParamSet);
|
||||
}
|
||||
|
||||
return new DERSequence(v);
|
||||
}
|
||||
}
|
||||
@@ -1,55 +0,0 @@
|
||||
package org.bouncycastle.asn1.eac;
|
||||
|
||||
import org.bouncycastle.asn1.DERObjectIdentifier;
|
||||
|
||||
public interface EACObjectIdentifiers
|
||||
{
|
||||
// bsi-de OBJECT IDENTIFIER ::= {
|
||||
// itu-t(0) identified-organization(4) etsi(0)
|
||||
// reserved(127) etsi-identified-organization(0) 7
|
||||
// }
|
||||
static final DERObjectIdentifier bsi_de = new DERObjectIdentifier("0.4.0.127.0.7");
|
||||
|
||||
// id-PK OBJECT IDENTIFIER ::= {
|
||||
// bsi-de protocols(2) smartcard(2) 1
|
||||
// }
|
||||
static final DERObjectIdentifier id_PK = new DERObjectIdentifier(bsi_de + ".2.2.1");
|
||||
|
||||
static final DERObjectIdentifier id_PK_DH = new DERObjectIdentifier(id_PK + ".1");
|
||||
static final DERObjectIdentifier id_PK_ECDH = new DERObjectIdentifier(id_PK + ".2");
|
||||
|
||||
// id-CA OBJECT IDENTIFIER ::= {
|
||||
// bsi-de protocols(2) smartcard(2) 3
|
||||
// }
|
||||
static final DERObjectIdentifier id_CA = new DERObjectIdentifier(bsi_de + ".2.2.3");
|
||||
static final DERObjectIdentifier id_CA_DH = new DERObjectIdentifier(id_CA + ".1");
|
||||
static final DERObjectIdentifier id_CA_DH_3DES_CBC_CBC = new DERObjectIdentifier(id_CA_DH + ".1");
|
||||
static final DERObjectIdentifier id_CA_ECDH = new DERObjectIdentifier(id_CA + ".2");
|
||||
static final DERObjectIdentifier id_CA_ECDH_3DES_CBC_CBC = new DERObjectIdentifier(id_CA_ECDH + ".1");
|
||||
|
||||
//
|
||||
// id-TA OBJECT IDENTIFIER ::= {
|
||||
// bsi-de protocols(2) smartcard(2) 2
|
||||
// }
|
||||
static final DERObjectIdentifier id_TA = new DERObjectIdentifier(bsi_de + ".2.2.2");
|
||||
|
||||
static final DERObjectIdentifier id_TA_RSA = new DERObjectIdentifier(id_TA + ".1");
|
||||
static final DERObjectIdentifier id_TA_RSA_v1_5_SHA_1 = new DERObjectIdentifier(id_TA_RSA + ".1");
|
||||
static final DERObjectIdentifier id_TA_RSA_v1_5_SHA_256 = new DERObjectIdentifier(id_TA_RSA + ".2");
|
||||
static final DERObjectIdentifier id_TA_RSA_PSS_SHA_1 = new DERObjectIdentifier(id_TA_RSA + ".3");
|
||||
static final DERObjectIdentifier id_TA_RSA_PSS_SHA_256 = new DERObjectIdentifier(id_TA_RSA + ".4");
|
||||
static final DERObjectIdentifier id_TA_ECDSA = new DERObjectIdentifier(id_TA + ".2");
|
||||
static final DERObjectIdentifier id_TA_ECDSA_SHA_1 = new DERObjectIdentifier(id_TA_ECDSA + ".1");
|
||||
static final DERObjectIdentifier id_TA_ECDSA_SHA_224 = new DERObjectIdentifier(id_TA_ECDSA + ".2");
|
||||
static final DERObjectIdentifier id_TA_ECDSA_SHA_256 = new DERObjectIdentifier(id_TA_ECDSA + ".3");
|
||||
|
||||
static final DERObjectIdentifier id_TA_ECDSA_SHA_384 = new DERObjectIdentifier(id_TA_ECDSA + ".4");
|
||||
static final DERObjectIdentifier id_TA_ECDSA_SHA_512 = new DERObjectIdentifier(id_TA_ECDSA + ".5");
|
||||
|
||||
/**
|
||||
* id-EAC-ePassport OBJECT IDENTIFIER ::= {
|
||||
* bsi-de applications(3) mrtd(1) roles(2) 1}
|
||||
*/
|
||||
static final DERObjectIdentifier id_EAC_ePassport = new DERObjectIdentifier(bsi_de + ".3.1.2.1");
|
||||
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
package org.bouncycastle.asn1.esf;
|
||||
|
||||
import org.bouncycastle.asn1.DERObjectIdentifier;
|
||||
import org.bouncycastle.asn1.pkcs.PKCSObjectIdentifiers;
|
||||
|
||||
public interface CommitmentTypeIdentifier
|
||||
{
|
||||
public static final DERObjectIdentifier proofOfOrigin = PKCSObjectIdentifiers.id_cti_ets_proofOfOrigin;
|
||||
public static final DERObjectIdentifier proofOfReceipt = PKCSObjectIdentifiers.id_cti_ets_proofOfReceipt;
|
||||
public static final DERObjectIdentifier proofOfDelivery = PKCSObjectIdentifiers.id_cti_ets_proofOfDelivery;
|
||||
public static final DERObjectIdentifier proofOfSender = PKCSObjectIdentifiers.id_cti_ets_proofOfSender;
|
||||
public static final DERObjectIdentifier proofOfApproval = PKCSObjectIdentifiers.id_cti_ets_proofOfApproval;
|
||||
public static final DERObjectIdentifier proofOfCreation = PKCSObjectIdentifiers.id_cti_ets_proofOfCreation;
|
||||
}
|
||||
@@ -1,83 +0,0 @@
|
||||
package org.bouncycastle.asn1.esf;
|
||||
|
||||
import org.bouncycastle.asn1.ASN1EncodableVector;
|
||||
import org.bouncycastle.asn1.ASN1Sequence;
|
||||
import org.bouncycastle.asn1.ASN1Encodable;
|
||||
import org.bouncycastle.asn1.DERObject;
|
||||
import org.bouncycastle.asn1.DERObjectIdentifier;
|
||||
import org.bouncycastle.asn1.DERSequence;
|
||||
|
||||
public class CommitmentTypeIndication
|
||||
extends ASN1Encodable
|
||||
{
|
||||
private DERObjectIdentifier commitmentTypeId;
|
||||
private ASN1Sequence commitmentTypeQualifier;
|
||||
|
||||
public CommitmentTypeIndication(
|
||||
ASN1Sequence seq)
|
||||
{
|
||||
commitmentTypeId = (DERObjectIdentifier)seq.getObjectAt(0);
|
||||
|
||||
if (seq.size() > 1)
|
||||
{
|
||||
commitmentTypeQualifier = (ASN1Sequence)seq.getObjectAt(1);
|
||||
}
|
||||
}
|
||||
|
||||
public CommitmentTypeIndication(
|
||||
DERObjectIdentifier commitmentTypeId)
|
||||
{
|
||||
this.commitmentTypeId = commitmentTypeId;
|
||||
}
|
||||
|
||||
public CommitmentTypeIndication(
|
||||
DERObjectIdentifier commitmentTypeId,
|
||||
ASN1Sequence commitmentTypeQualifier)
|
||||
{
|
||||
this.commitmentTypeId = commitmentTypeId;
|
||||
this.commitmentTypeQualifier = commitmentTypeQualifier;
|
||||
}
|
||||
|
||||
public static CommitmentTypeIndication getInstance(
|
||||
Object obj)
|
||||
{
|
||||
if (obj == null || obj instanceof CommitmentTypeIndication)
|
||||
{
|
||||
return (CommitmentTypeIndication)obj;
|
||||
}
|
||||
|
||||
return new CommitmentTypeIndication(ASN1Sequence.getInstance(obj));
|
||||
}
|
||||
|
||||
public DERObjectIdentifier getCommitmentTypeId()
|
||||
{
|
||||
return commitmentTypeId;
|
||||
}
|
||||
|
||||
public ASN1Sequence getCommitmentTypeQualifier()
|
||||
{
|
||||
return commitmentTypeQualifier;
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* CommitmentTypeIndication ::= SEQUENCE {
|
||||
* commitmentTypeId CommitmentTypeIdentifier,
|
||||
* commitmentTypeQualifier SEQUENCE SIZE (1..MAX) OF
|
||||
* CommitmentTypeQualifier OPTIONAL }
|
||||
* </pre>
|
||||
*/
|
||||
public DERObject toASN1Object()
|
||||
{
|
||||
ASN1EncodableVector v = new ASN1EncodableVector();
|
||||
|
||||
v.add(commitmentTypeId);
|
||||
|
||||
if (commitmentTypeQualifier != null)
|
||||
{
|
||||
v.add(commitmentTypeQualifier);
|
||||
}
|
||||
|
||||
return new DERSequence(v);
|
||||
}
|
||||
}
|
||||
@@ -1,108 +0,0 @@
|
||||
package org.bouncycastle.asn1.esf;
|
||||
|
||||
import org.bouncycastle.asn1.ASN1Encodable;
|
||||
import org.bouncycastle.asn1.ASN1EncodableVector;
|
||||
import org.bouncycastle.asn1.ASN1Sequence;
|
||||
import org.bouncycastle.asn1.DEREncodable;
|
||||
import org.bouncycastle.asn1.DERObject;
|
||||
import org.bouncycastle.asn1.DERObjectIdentifier;
|
||||
import org.bouncycastle.asn1.DERSequence;
|
||||
|
||||
/**
|
||||
* Commitment type qualifiers, used in the Commitment-Type-Indication attribute (RFC3126).
|
||||
*
|
||||
* <pre>
|
||||
* CommitmentTypeQualifier ::= SEQUENCE {
|
||||
* commitmentTypeIdentifier CommitmentTypeIdentifier,
|
||||
* qualifier ANY DEFINED BY commitmentTypeIdentifier OPTIONAL }
|
||||
* </pre>
|
||||
*/
|
||||
public class CommitmentTypeQualifier
|
||||
extends ASN1Encodable
|
||||
{
|
||||
private DERObjectIdentifier commitmentTypeIdentifier;
|
||||
private DEREncodable qualifier;
|
||||
|
||||
/**
|
||||
* Creates a new <code>CommitmentTypeQualifier</code> instance.
|
||||
*
|
||||
* @param commitmentTypeIdentifier a <code>CommitmentTypeIdentifier</code> value
|
||||
*/
|
||||
public CommitmentTypeQualifier(
|
||||
DERObjectIdentifier commitmentTypeIdentifier)
|
||||
{
|
||||
this(commitmentTypeIdentifier, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new <code>CommitmentTypeQualifier</code> instance.
|
||||
*
|
||||
* @param commitmentTypeIdentifier a <code>CommitmentTypeIdentifier</code> value
|
||||
* @param qualifier the qualifier, defined by the above field.
|
||||
*/
|
||||
public CommitmentTypeQualifier(
|
||||
DERObjectIdentifier commitmentTypeIdentifier,
|
||||
DEREncodable qualifier)
|
||||
{
|
||||
this.commitmentTypeIdentifier = commitmentTypeIdentifier;
|
||||
this.qualifier = qualifier;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new <code>CommitmentTypeQualifier</code> instance.
|
||||
*
|
||||
* @param as <code>CommitmentTypeQualifier</code> structure
|
||||
* encoded as an ASN1Sequence.
|
||||
*/
|
||||
public CommitmentTypeQualifier(
|
||||
ASN1Sequence as)
|
||||
{
|
||||
commitmentTypeIdentifier = (DERObjectIdentifier)as.getObjectAt(0);
|
||||
|
||||
if (as.size() > 1)
|
||||
{
|
||||
qualifier = as.getObjectAt(1);
|
||||
}
|
||||
}
|
||||
|
||||
public static CommitmentTypeQualifier getInstance(Object as)
|
||||
{
|
||||
if (as instanceof CommitmentTypeQualifier || as == null)
|
||||
{
|
||||
return (CommitmentTypeQualifier)as;
|
||||
}
|
||||
else if (as instanceof ASN1Sequence)
|
||||
{
|
||||
return new CommitmentTypeQualifier((ASN1Sequence)as);
|
||||
}
|
||||
|
||||
throw new IllegalArgumentException("unknown object in getInstance.");
|
||||
}
|
||||
|
||||
public DERObjectIdentifier getCommitmentTypeIdentifier()
|
||||
{
|
||||
return commitmentTypeIdentifier;
|
||||
}
|
||||
|
||||
public DEREncodable getQualifier()
|
||||
{
|
||||
return qualifier;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a DER-encodable representation of this instance.
|
||||
*
|
||||
* @return a <code>DERObject</code> value
|
||||
*/
|
||||
public DERObject toASN1Object()
|
||||
{
|
||||
ASN1EncodableVector dev = new ASN1EncodableVector();
|
||||
dev.add(commitmentTypeIdentifier);
|
||||
if (qualifier != null)
|
||||
{
|
||||
dev.add(qualifier);
|
||||
}
|
||||
|
||||
return new DERSequence(dev);
|
||||
}
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
package org.bouncycastle.asn1.esf;
|
||||
|
||||
import org.bouncycastle.asn1.DERObjectIdentifier;
|
||||
import org.bouncycastle.asn1.pkcs.PKCSObjectIdentifiers;
|
||||
|
||||
public interface ESFAttributes
|
||||
{
|
||||
public static final DERObjectIdentifier sigPolicyId = PKCSObjectIdentifiers.id_aa_ets_sigPolicyId;
|
||||
public static final DERObjectIdentifier commitmentType = PKCSObjectIdentifiers.id_aa_ets_commitmentType;
|
||||
public static final DERObjectIdentifier signerLocation = PKCSObjectIdentifiers.id_aa_ets_signerLocation;
|
||||
public static final DERObjectIdentifier signerAttr = PKCSObjectIdentifiers.id_aa_ets_signerAttr;
|
||||
public static final DERObjectIdentifier otherSigCert = PKCSObjectIdentifiers.id_aa_ets_otherSigCert;
|
||||
public static final DERObjectIdentifier contentTimestamp = PKCSObjectIdentifiers.id_aa_ets_contentTimestamp;
|
||||
public static final DERObjectIdentifier certificateRefs = PKCSObjectIdentifiers.id_aa_ets_certificateRefs;
|
||||
public static final DERObjectIdentifier revocationRefs = PKCSObjectIdentifiers.id_aa_ets_revocationRefs;
|
||||
public static final DERObjectIdentifier certValues = PKCSObjectIdentifiers.id_aa_ets_certValues;
|
||||
public static final DERObjectIdentifier revocationValues = PKCSObjectIdentifiers.id_aa_ets_revocationValues;
|
||||
public static final DERObjectIdentifier escTimeStamp = PKCSObjectIdentifiers.id_aa_ets_escTimeStamp;
|
||||
public static final DERObjectIdentifier certCRLTimestamp = PKCSObjectIdentifiers.id_aa_ets_certCRLTimestamp;
|
||||
public static final DERObjectIdentifier archiveTimestamp = PKCSObjectIdentifiers.id_aa_ets_archiveTimestamp;
|
||||
}
|
||||
@@ -1,78 +0,0 @@
|
||||
package org.bouncycastle.asn1.esf;
|
||||
|
||||
import org.bouncycastle.asn1.x509.AlgorithmIdentifier;
|
||||
import org.bouncycastle.asn1.*;
|
||||
|
||||
public class OtherHashAlgAndValue
|
||||
extends ASN1Encodable
|
||||
{
|
||||
private AlgorithmIdentifier hashAlgorithm;
|
||||
private ASN1OctetString hashValue;
|
||||
|
||||
|
||||
public static OtherHashAlgAndValue getInstance(
|
||||
Object obj)
|
||||
{
|
||||
if (obj == null || obj instanceof OtherHashAlgAndValue)
|
||||
{
|
||||
return (OtherHashAlgAndValue) obj;
|
||||
}
|
||||
else if (obj instanceof ASN1Sequence)
|
||||
{
|
||||
return new OtherHashAlgAndValue((ASN1Sequence) obj);
|
||||
}
|
||||
|
||||
throw new IllegalArgumentException(
|
||||
"unknown object in 'OtherHashAlgAndValue' factory : "
|
||||
+ obj.getClass().getName() + ".");
|
||||
}
|
||||
|
||||
public OtherHashAlgAndValue(
|
||||
ASN1Sequence seq)
|
||||
{
|
||||
if (seq.size() != 2)
|
||||
{
|
||||
throw new IllegalArgumentException("Bad sequence size: " + seq.size());
|
||||
}
|
||||
|
||||
hashAlgorithm = AlgorithmIdentifier.getInstance(seq.getObjectAt(0));
|
||||
hashValue = ASN1OctetString.getInstance(seq.getObjectAt(1));
|
||||
}
|
||||
|
||||
public OtherHashAlgAndValue(
|
||||
AlgorithmIdentifier hashAlgorithm,
|
||||
ASN1OctetString hashValue)
|
||||
{
|
||||
this.hashAlgorithm = hashAlgorithm;
|
||||
this.hashValue = hashValue;
|
||||
}
|
||||
|
||||
public AlgorithmIdentifier getHashAlgorithm()
|
||||
{
|
||||
return hashAlgorithm;
|
||||
}
|
||||
|
||||
public ASN1OctetString getHashValue()
|
||||
{
|
||||
return hashValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* OtherHashAlgAndValue ::= SEQUENCE {
|
||||
* hashAlgorithm AlgorithmIdentifier,
|
||||
* hashValue OtherHashValue }
|
||||
*
|
||||
* OtherHashValue ::= OCTET STRING
|
||||
* </pre>
|
||||
*/
|
||||
public DERObject toASN1Object()
|
||||
{
|
||||
ASN1EncodableVector v = new ASN1EncodableVector();
|
||||
|
||||
v.add(hashAlgorithm);
|
||||
v.add(hashValue);
|
||||
|
||||
return new DERSequence(v);
|
||||
}
|
||||
}
|
||||
@@ -1,95 +0,0 @@
|
||||
package org.bouncycastle.asn1.esf;
|
||||
|
||||
import org.bouncycastle.asn1.x509.NoticeReference;
|
||||
import org.bouncycastle.asn1.x509.DisplayText;
|
||||
import org.bouncycastle.asn1.*;
|
||||
|
||||
import java.util.Enumeration;
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public class SPUserNotice
|
||||
{
|
||||
private NoticeReference noticeRef;
|
||||
private DisplayText explicitText;
|
||||
|
||||
public static SPUserNotice getInstance(
|
||||
Object obj)
|
||||
{
|
||||
if (obj == null || obj instanceof SPUserNotice)
|
||||
{
|
||||
return (SPUserNotice) obj;
|
||||
}
|
||||
else if (obj instanceof ASN1Sequence)
|
||||
{
|
||||
return new SPUserNotice((ASN1Sequence) obj);
|
||||
}
|
||||
|
||||
throw new IllegalArgumentException(
|
||||
"unknown object in 'SPUserNotice' factory : "
|
||||
+ obj.getClass().getName() + ".");
|
||||
}
|
||||
|
||||
public SPUserNotice(
|
||||
ASN1Sequence seq)
|
||||
{
|
||||
Enumeration e = seq.getObjects();
|
||||
while (e.hasMoreElements())
|
||||
{
|
||||
DEREncodable object = (DEREncodable) e.nextElement();
|
||||
if (object instanceof NoticeReference)
|
||||
{
|
||||
noticeRef = NoticeReference.getInstance(object);
|
||||
}
|
||||
else if (object instanceof DisplayText)
|
||||
{
|
||||
explicitText = DisplayText.getInstance(object);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new IllegalArgumentException("Invalid element in 'SPUserNotice'.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public SPUserNotice(
|
||||
NoticeReference noticeRef,
|
||||
DisplayText explicitText)
|
||||
{
|
||||
this.noticeRef = noticeRef;
|
||||
this.explicitText = explicitText;
|
||||
}
|
||||
|
||||
public NoticeReference getNoticeRef()
|
||||
{
|
||||
return noticeRef;
|
||||
}
|
||||
|
||||
public DisplayText getExplicitText()
|
||||
{
|
||||
return explicitText;
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* SPUserNotice ::= SEQUENCE {
|
||||
* noticeRef NoticeReference OPTIONAL,
|
||||
* explicitText DisplayText OPTIONAL }
|
||||
* </pre>
|
||||
*/
|
||||
public DERObject toASN1Object()
|
||||
{
|
||||
ASN1EncodableVector v = new ASN1EncodableVector();
|
||||
|
||||
if (noticeRef != null)
|
||||
{
|
||||
v.add(noticeRef);
|
||||
}
|
||||
|
||||
if (explicitText != null)
|
||||
{
|
||||
v.add(explicitText);
|
||||
}
|
||||
|
||||
return new DERSequence(v);
|
||||
}
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
package org.bouncycastle.asn1.esf;
|
||||
|
||||
import org.bouncycastle.asn1.DERIA5String;
|
||||
import org.bouncycastle.asn1.DERObject;
|
||||
|
||||
public class SPuri
|
||||
{
|
||||
private DERIA5String uri;
|
||||
|
||||
public static SPuri getInstance(
|
||||
Object obj)
|
||||
{
|
||||
if (obj instanceof SPuri)
|
||||
{
|
||||
return (SPuri) obj;
|
||||
}
|
||||
else if (obj instanceof DERIA5String)
|
||||
{
|
||||
return new SPuri((DERIA5String) obj);
|
||||
}
|
||||
|
||||
throw new IllegalArgumentException(
|
||||
"unknown object in 'SPuri' factory: "
|
||||
+ obj.getClass().getName() + ".");
|
||||
}
|
||||
|
||||
public SPuri(
|
||||
DERIA5String uri)
|
||||
{
|
||||
this.uri = uri;
|
||||
}
|
||||
|
||||
public DERIA5String getUri()
|
||||
{
|
||||
return uri;
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* SPuri ::= IA5String
|
||||
* </pre>
|
||||
*/
|
||||
public DERObject toASN1Object()
|
||||
{
|
||||
return uri.getDERObject();
|
||||
}
|
||||
}
|
||||
@@ -1,71 +0,0 @@
|
||||
package org.bouncycastle.asn1.esf;
|
||||
|
||||
import org.bouncycastle.asn1.*;
|
||||
|
||||
public class SigPolicyQualifierInfo
|
||||
extends ASN1Encodable
|
||||
{
|
||||
private DERObjectIdentifier sigPolicyQualifierId;
|
||||
private DEREncodable sigQualifier;
|
||||
|
||||
public SigPolicyQualifierInfo(
|
||||
DERObjectIdentifier sigPolicyQualifierId,
|
||||
DEREncodable sigQualifier)
|
||||
{
|
||||
this.sigPolicyQualifierId = sigPolicyQualifierId;
|
||||
this.sigQualifier = sigQualifier;
|
||||
}
|
||||
|
||||
public SigPolicyQualifierInfo(
|
||||
ASN1Sequence seq)
|
||||
{
|
||||
sigPolicyQualifierId = DERObjectIdentifier.getInstance(seq.getObjectAt(0));
|
||||
sigQualifier = seq.getObjectAt(1);
|
||||
}
|
||||
|
||||
public static SigPolicyQualifierInfo getInstance(
|
||||
Object obj)
|
||||
{
|
||||
if (obj == null || obj instanceof SigPolicyQualifierInfo)
|
||||
{
|
||||
return (SigPolicyQualifierInfo) obj;
|
||||
}
|
||||
else if (obj instanceof ASN1Sequence)
|
||||
{
|
||||
return new SigPolicyQualifierInfo((ASN1Sequence) obj);
|
||||
}
|
||||
|
||||
throw new IllegalArgumentException(
|
||||
"unknown object in 'SigPolicyQualifierInfo' factory: "
|
||||
+ obj.getClass().getName() + ".");
|
||||
}
|
||||
|
||||
public DERObjectIdentifier getSigPolicyQualifierId()
|
||||
{
|
||||
return sigPolicyQualifierId;
|
||||
}
|
||||
|
||||
public DEREncodable getSigQualifier()
|
||||
{
|
||||
return sigQualifier;
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* SigPolicyQualifierInfo ::= SEQUENCE {
|
||||
* sigPolicyQualifierId SigPolicyQualifierId,
|
||||
* sigQualifier ANY DEFINED BY sigPolicyQualifierId }
|
||||
*
|
||||
* SigPolicyQualifierId ::= OBJECT IDENTIFIER
|
||||
* </pre>
|
||||
*/
|
||||
public DERObject toASN1Object()
|
||||
{
|
||||
ASN1EncodableVector v = new ASN1EncodableVector();
|
||||
|
||||
v.add(sigPolicyQualifierId);
|
||||
v.add(sigQualifier);
|
||||
|
||||
return new DERSequence(v);
|
||||
}
|
||||
}
|
||||
@@ -1,75 +0,0 @@
|
||||
package org.bouncycastle.asn1.esf;
|
||||
|
||||
import org.bouncycastle.asn1.*;
|
||||
|
||||
public class SigPolicyQualifiers
|
||||
extends ASN1Encodable
|
||||
{
|
||||
ASN1Sequence qualifiers;
|
||||
|
||||
public static SigPolicyQualifiers getInstance(
|
||||
Object obj)
|
||||
{
|
||||
if (obj instanceof SigPolicyQualifiers)
|
||||
{
|
||||
return (SigPolicyQualifiers) obj;
|
||||
}
|
||||
else if (obj instanceof ASN1Sequence)
|
||||
{
|
||||
return new SigPolicyQualifiers((ASN1Sequence) obj);
|
||||
}
|
||||
|
||||
throw new IllegalArgumentException(
|
||||
"unknown object in 'SigPolicyQualifiers' factory: "
|
||||
+ obj.getClass().getName() + ".");
|
||||
}
|
||||
|
||||
public SigPolicyQualifiers(
|
||||
ASN1Sequence seq)
|
||||
{
|
||||
qualifiers = seq;
|
||||
}
|
||||
|
||||
public SigPolicyQualifiers(
|
||||
SigPolicyQualifierInfo[] qualifierInfos)
|
||||
{
|
||||
ASN1EncodableVector v = new ASN1EncodableVector();
|
||||
for (int i=0; i < qualifierInfos.length; i++)
|
||||
{
|
||||
v.add(qualifierInfos[i]);
|
||||
}
|
||||
qualifiers = new DERSequence(v);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the number of qualifier info elements present.
|
||||
*
|
||||
* @return number of elements present.
|
||||
*/
|
||||
public int size()
|
||||
{
|
||||
return qualifiers.size();
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the SigPolicyQualifierInfo at index i.
|
||||
*
|
||||
* @param i index of the string of interest
|
||||
* @return the string at index i.
|
||||
*/
|
||||
public SigPolicyQualifierInfo getStringAt(
|
||||
int i)
|
||||
{
|
||||
return SigPolicyQualifierInfo.getInstance(qualifiers.getObjectAt(i));
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* SigPolicyQualifiers ::= SEQUENCE SIZE (1..MAX) OF SigPolicyQualifierInfo
|
||||
* </pre>
|
||||
*/
|
||||
public DERObject toASN1Object()
|
||||
{
|
||||
return qualifiers;
|
||||
}
|
||||
}
|
||||
@@ -1,100 +0,0 @@
|
||||
package org.bouncycastle.asn1.esf;
|
||||
|
||||
import org.bouncycastle.asn1.*;
|
||||
|
||||
public class SignaturePolicyId
|
||||
extends ASN1Encodable
|
||||
{
|
||||
private DERObjectIdentifier sigPolicyId;
|
||||
private OtherHashAlgAndValue sigPolicyHash;
|
||||
private SigPolicyQualifiers sigPolicyQualifiers;
|
||||
|
||||
|
||||
public static SignaturePolicyId getInstance(
|
||||
Object obj)
|
||||
{
|
||||
if (obj == null || obj instanceof SignaturePolicyId)
|
||||
{
|
||||
return (SignaturePolicyId) obj;
|
||||
}
|
||||
else if (obj instanceof ASN1Sequence)
|
||||
{
|
||||
return new SignaturePolicyId((ASN1Sequence) obj);
|
||||
}
|
||||
|
||||
throw new IllegalArgumentException(
|
||||
"Unknown object in 'SignaturePolicyId' factory : "
|
||||
+ obj.getClass().getName() + ".");
|
||||
}
|
||||
|
||||
public SignaturePolicyId(
|
||||
ASN1Sequence seq)
|
||||
{
|
||||
if (seq.size() != 2 && seq.size() != 3)
|
||||
{
|
||||
throw new IllegalArgumentException("Bad sequence size: " + seq.size());
|
||||
}
|
||||
|
||||
sigPolicyId = DERObjectIdentifier.getInstance(seq.getObjectAt(0));
|
||||
sigPolicyHash = OtherHashAlgAndValue.getInstance(seq.getObjectAt(1));
|
||||
|
||||
if (seq.size() == 3)
|
||||
{
|
||||
sigPolicyQualifiers = SigPolicyQualifiers.getInstance(seq.getObjectAt(2));
|
||||
}
|
||||
}
|
||||
|
||||
public SignaturePolicyId(
|
||||
DERObjectIdentifier sigPolicyIdentifier,
|
||||
OtherHashAlgAndValue sigPolicyHash)
|
||||
{
|
||||
this(sigPolicyIdentifier, sigPolicyHash, null);
|
||||
}
|
||||
|
||||
public SignaturePolicyId(
|
||||
DERObjectIdentifier sigPolicyId,
|
||||
OtherHashAlgAndValue sigPolicyHash,
|
||||
SigPolicyQualifiers sigPolicyQualifiers)
|
||||
{
|
||||
this.sigPolicyId = sigPolicyId;
|
||||
this.sigPolicyHash = sigPolicyHash;
|
||||
this.sigPolicyQualifiers = sigPolicyQualifiers;
|
||||
}
|
||||
|
||||
public DERObjectIdentifier getSigPolicyId()
|
||||
{
|
||||
return sigPolicyId;
|
||||
}
|
||||
|
||||
public OtherHashAlgAndValue getSigPolicyHash()
|
||||
{
|
||||
return sigPolicyHash;
|
||||
}
|
||||
|
||||
public SigPolicyQualifiers getSigPolicyQualifiers()
|
||||
{
|
||||
return sigPolicyQualifiers;
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* SignaturePolicyId ::= SEQUENCE {
|
||||
* sigPolicyId SigPolicyId,
|
||||
* sigPolicyHash SigPolicyHash,
|
||||
* sigPolicyQualifiers SEQUENCE SIZE (1..MAX) OF SigPolicyQualifierInfo OPTIONAL}
|
||||
* </pre>
|
||||
*/
|
||||
public DERObject toASN1Object()
|
||||
{
|
||||
ASN1EncodableVector v = new ASN1EncodableVector();
|
||||
|
||||
v.add(sigPolicyId);
|
||||
v.add(sigPolicyHash);
|
||||
if (sigPolicyQualifiers != null)
|
||||
{
|
||||
v.add(sigPolicyQualifiers);
|
||||
}
|
||||
|
||||
return new DERSequence(v);
|
||||
}
|
||||
}
|
||||
@@ -1,74 +0,0 @@
|
||||
package org.bouncycastle.asn1.esf;
|
||||
|
||||
import org.bouncycastle.asn1.*;
|
||||
|
||||
public class SignaturePolicyIdentifier
|
||||
extends ASN1Encodable
|
||||
{
|
||||
private SignaturePolicyId signaturePolicyId;
|
||||
private boolean isSignaturePolicyImplied;
|
||||
|
||||
public static SignaturePolicyIdentifier getInstance(
|
||||
Object obj)
|
||||
{
|
||||
if (obj == null || obj instanceof SignaturePolicyIdentifier)
|
||||
{
|
||||
return (SignaturePolicyIdentifier) obj;
|
||||
}
|
||||
else if (obj instanceof ASN1Sequence)
|
||||
{
|
||||
return new SignaturePolicyIdentifier(SignaturePolicyId.getInstance(obj));
|
||||
}
|
||||
else if (obj instanceof ASN1Null)
|
||||
{
|
||||
return new SignaturePolicyIdentifier();
|
||||
}
|
||||
|
||||
throw new IllegalArgumentException(
|
||||
"unknown object in 'SignaturePolicyIdentifier' factory: "
|
||||
+ obj.getClass().getName() + ".");
|
||||
}
|
||||
|
||||
public SignaturePolicyIdentifier()
|
||||
{
|
||||
this.isSignaturePolicyImplied = true;
|
||||
}
|
||||
|
||||
public SignaturePolicyIdentifier(
|
||||
SignaturePolicyId signaturePolicyId)
|
||||
{
|
||||
this.signaturePolicyId = signaturePolicyId;
|
||||
this.isSignaturePolicyImplied = false;
|
||||
}
|
||||
|
||||
public SignaturePolicyId getSignaturePolicyId()
|
||||
{
|
||||
return signaturePolicyId;
|
||||
}
|
||||
|
||||
public boolean isSignaturePolicyImplied()
|
||||
{
|
||||
return isSignaturePolicyImplied;
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* SignaturePolicyIdentifier ::= CHOICE{
|
||||
* SignaturePolicyId SignaturePolicyId,
|
||||
* SignaturePolicyImplied SignaturePolicyImplied }
|
||||
*
|
||||
* SignaturePolicyImplied ::= NULL
|
||||
* </pre>
|
||||
*/
|
||||
public DERObject toASN1Object()
|
||||
{
|
||||
if (isSignaturePolicyImplied)
|
||||
{
|
||||
return new DERNull();
|
||||
}
|
||||
else
|
||||
{
|
||||
return signaturePolicyId.getDERObject();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,160 +0,0 @@
|
||||
package org.bouncycastle.asn1.esf;
|
||||
|
||||
import org.bouncycastle.asn1.ASN1Encodable;
|
||||
import org.bouncycastle.asn1.ASN1EncodableVector;
|
||||
import org.bouncycastle.asn1.ASN1Sequence;
|
||||
import org.bouncycastle.asn1.DERObject;
|
||||
import org.bouncycastle.asn1.DERSequence;
|
||||
import org.bouncycastle.asn1.DERTaggedObject;
|
||||
import org.bouncycastle.asn1.DERUTF8String;
|
||||
|
||||
import java.util.Enumeration;
|
||||
|
||||
/**
|
||||
* Signer-Location attribute (RFC3126).
|
||||
*
|
||||
* <pre>
|
||||
* SignerLocation ::= SEQUENCE {
|
||||
* countryName [0] DirectoryString OPTIONAL,
|
||||
* localityName [1] DirectoryString OPTIONAL,
|
||||
* postalAddress [2] PostalAddress OPTIONAL }
|
||||
*
|
||||
* PostalAddress ::= SEQUENCE SIZE(1..6) OF DirectoryString
|
||||
* </pre>
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public class SignerLocation
|
||||
extends ASN1Encodable
|
||||
{
|
||||
private DERUTF8String countryName;
|
||||
private DERUTF8String localityName;
|
||||
private ASN1Sequence postalAddress;
|
||||
|
||||
public SignerLocation(
|
||||
ASN1Sequence seq)
|
||||
{
|
||||
Enumeration e = seq.getObjects();
|
||||
|
||||
while (e.hasMoreElements())
|
||||
{
|
||||
DERTaggedObject o = (DERTaggedObject)e.nextElement();
|
||||
|
||||
switch (o.getTagNo())
|
||||
{
|
||||
case 0:
|
||||
this.countryName = DERUTF8String.getInstance(o, true);
|
||||
break;
|
||||
case 1:
|
||||
this.localityName = DERUTF8String.getInstance(o, true);
|
||||
break;
|
||||
case 2:
|
||||
if (o.isExplicit())
|
||||
{
|
||||
this.postalAddress = ASN1Sequence.getInstance(o, true);
|
||||
}
|
||||
else // handle erroneous implicitly tagged sequences
|
||||
{
|
||||
this.postalAddress = ASN1Sequence.getInstance(o, false);
|
||||
}
|
||||
if (postalAddress != null && postalAddress.size() > 6)
|
||||
{
|
||||
throw new IllegalArgumentException("postal address must contain less than 6 strings");
|
||||
}
|
||||
break;
|
||||
default:
|
||||
throw new IllegalArgumentException("illegal tag");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public SignerLocation(
|
||||
DERUTF8String countryName,
|
||||
DERUTF8String localityName,
|
||||
ASN1Sequence postalAddress)
|
||||
{
|
||||
if (postalAddress != null && postalAddress.size() > 6)
|
||||
{
|
||||
throw new IllegalArgumentException("postal address must contain less than 6 strings");
|
||||
}
|
||||
|
||||
if (countryName != null)
|
||||
{
|
||||
this.countryName = DERUTF8String.getInstance(countryName.toASN1Object());
|
||||
}
|
||||
|
||||
if (localityName != null)
|
||||
{
|
||||
this.localityName = DERUTF8String.getInstance(localityName.toASN1Object());
|
||||
}
|
||||
|
||||
if (postalAddress != null)
|
||||
{
|
||||
this.postalAddress = ASN1Sequence.getInstance(postalAddress.toASN1Object());
|
||||
}
|
||||
}
|
||||
|
||||
public static SignerLocation getInstance(
|
||||
Object obj)
|
||||
{
|
||||
if (obj == null || obj instanceof SignerLocation)
|
||||
{
|
||||
return (SignerLocation)obj;
|
||||
}
|
||||
|
||||
return new SignerLocation(ASN1Sequence.getInstance(obj));
|
||||
}
|
||||
|
||||
public DERUTF8String getCountryName()
|
||||
{
|
||||
return countryName;
|
||||
}
|
||||
|
||||
public DERUTF8String getLocalityName()
|
||||
{
|
||||
return localityName;
|
||||
}
|
||||
|
||||
public ASN1Sequence getPostalAddress()
|
||||
{
|
||||
return postalAddress;
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* SignerLocation ::= SEQUENCE {
|
||||
* countryName [0] DirectoryString OPTIONAL,
|
||||
* localityName [1] DirectoryString OPTIONAL,
|
||||
* postalAddress [2] PostalAddress OPTIONAL }
|
||||
*
|
||||
* PostalAddress ::= SEQUENCE SIZE(1..6) OF DirectoryString
|
||||
*
|
||||
* DirectoryString ::= CHOICE {
|
||||
* teletexString TeletexString (SIZE (1..MAX)),
|
||||
* printableString PrintableString (SIZE (1..MAX)),
|
||||
* universalString UniversalString (SIZE (1..MAX)),
|
||||
* utf8String UTF8String (SIZE (1.. MAX)),
|
||||
* bmpString BMPString (SIZE (1..MAX)) }
|
||||
* </pre>
|
||||
*/
|
||||
public DERObject toASN1Object()
|
||||
{
|
||||
ASN1EncodableVector v = new ASN1EncodableVector();
|
||||
|
||||
if (countryName != null)
|
||||
{
|
||||
v.add(new DERTaggedObject(true, 0, countryName));
|
||||
}
|
||||
|
||||
if (localityName != null)
|
||||
{
|
||||
v.add(new DERTaggedObject(true, 1, localityName));
|
||||
}
|
||||
|
||||
if (postalAddress != null)
|
||||
{
|
||||
v.add(new DERTaggedObject(true, 2, postalAddress));
|
||||
}
|
||||
|
||||
return new DERSequence(v);
|
||||
}
|
||||
}
|
||||
@@ -1,96 +0,0 @@
|
||||
package org.bouncycastle.asn1.ess;
|
||||
|
||||
import org.bouncycastle.asn1.ASN1Encodable;
|
||||
import org.bouncycastle.asn1.ASN1EncodableVector;
|
||||
import org.bouncycastle.asn1.ASN1Sequence;
|
||||
import org.bouncycastle.asn1.DEREncodable;
|
||||
import org.bouncycastle.asn1.DERObject;
|
||||
import org.bouncycastle.asn1.DERObjectIdentifier;
|
||||
import org.bouncycastle.asn1.DERSequence;
|
||||
import org.bouncycastle.asn1.DERUTF8String;
|
||||
|
||||
public class ContentHints
|
||||
extends ASN1Encodable
|
||||
{
|
||||
private DERUTF8String contentDescription;
|
||||
private DERObjectIdentifier contentType;
|
||||
|
||||
public static ContentHints getInstance(Object o)
|
||||
{
|
||||
if (o == null || o instanceof ContentHints)
|
||||
{
|
||||
return (ContentHints)o;
|
||||
}
|
||||
else if (o instanceof ASN1Sequence)
|
||||
{
|
||||
return new ContentHints((ASN1Sequence)o);
|
||||
}
|
||||
|
||||
throw new IllegalArgumentException(
|
||||
"unknown object in 'ContentHints' factory : "
|
||||
+ o.getClass().getName() + ".");
|
||||
}
|
||||
|
||||
/**
|
||||
* constructor
|
||||
*/
|
||||
private ContentHints(ASN1Sequence seq)
|
||||
{
|
||||
DEREncodable field = seq.getObjectAt(0);
|
||||
if (field.getDERObject() instanceof DERUTF8String)
|
||||
{
|
||||
contentDescription = DERUTF8String.getInstance(field);
|
||||
contentType = DERObjectIdentifier.getInstance(seq.getObjectAt(1));
|
||||
}
|
||||
else
|
||||
{
|
||||
contentType = DERObjectIdentifier.getInstance(seq.getObjectAt(0));
|
||||
}
|
||||
}
|
||||
|
||||
public ContentHints(
|
||||
DERObjectIdentifier contentType)
|
||||
{
|
||||
this.contentType = contentType;
|
||||
this.contentDescription = null;
|
||||
}
|
||||
|
||||
public ContentHints(
|
||||
DERObjectIdentifier contentType,
|
||||
DERUTF8String contentDescription)
|
||||
{
|
||||
this.contentType = contentType;
|
||||
this.contentDescription = contentDescription;
|
||||
}
|
||||
|
||||
public DERObjectIdentifier getContentType()
|
||||
{
|
||||
return contentType;
|
||||
}
|
||||
|
||||
public DERUTF8String getContentDescription()
|
||||
{
|
||||
return contentDescription;
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* ContentHints ::= SEQUENCE {
|
||||
* contentDescription UTF8String (SIZE (1..MAX)) OPTIONAL,
|
||||
* contentType ContentType }
|
||||
* </pre>
|
||||
*/
|
||||
public DERObject toASN1Object()
|
||||
{
|
||||
ASN1EncodableVector v = new ASN1EncodableVector();
|
||||
|
||||
if (contentDescription != null)
|
||||
{
|
||||
v.add(contentDescription);
|
||||
}
|
||||
|
||||
v.add(contentType);
|
||||
|
||||
return new DERSequence(v);
|
||||
}
|
||||
}
|
||||
@@ -1,65 +0,0 @@
|
||||
package org.bouncycastle.asn1.ess;
|
||||
|
||||
import org.bouncycastle.asn1.ASN1Encodable;
|
||||
import org.bouncycastle.asn1.ASN1OctetString;
|
||||
import org.bouncycastle.asn1.DERObject;
|
||||
import org.bouncycastle.asn1.DEROctetString;
|
||||
|
||||
public class ContentIdentifier
|
||||
extends ASN1Encodable
|
||||
{
|
||||
ASN1OctetString value;
|
||||
|
||||
public static ContentIdentifier getInstance(Object o)
|
||||
{
|
||||
if (o == null || o instanceof ContentIdentifier)
|
||||
{
|
||||
return (ContentIdentifier) o;
|
||||
}
|
||||
else if (o instanceof ASN1OctetString)
|
||||
{
|
||||
return new ContentIdentifier((ASN1OctetString) o);
|
||||
}
|
||||
|
||||
throw new IllegalArgumentException(
|
||||
"unknown object in 'ContentIdentifier' factory : "
|
||||
+ o.getClass().getName() + ".");
|
||||
}
|
||||
|
||||
/**
|
||||
* Create from OCTET STRING whose octets represent the identifier.
|
||||
*/
|
||||
public ContentIdentifier(
|
||||
ASN1OctetString value)
|
||||
{
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create from byte array representing the identifier.
|
||||
*/
|
||||
public ContentIdentifier(
|
||||
byte[] value)
|
||||
{
|
||||
this(new DEROctetString(value));
|
||||
}
|
||||
|
||||
public ASN1OctetString getValue()
|
||||
{
|
||||
return value;
|
||||
}
|
||||
|
||||
/**
|
||||
* The definition of ContentIdentifier is
|
||||
* <pre>
|
||||
* ContentIdentifier ::= OCTET STRING
|
||||
* </pre>
|
||||
* id-aa-contentIdentifier OBJECT IDENTIFIER ::= { iso(1)
|
||||
* member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs9(9)
|
||||
* smime(16) id-aa(2) 7 }
|
||||
*/
|
||||
public DERObject toASN1Object()
|
||||
{
|
||||
return value;
|
||||
}
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
package org.bouncycastle.asn1.iana;
|
||||
|
||||
import org.bouncycastle.asn1.DERObjectIdentifier;
|
||||
|
||||
public interface IANAObjectIdentifiers
|
||||
{
|
||||
// id-SHA1 OBJECT IDENTIFIER ::=
|
||||
// {iso(1) identified-organization(3) dod(6) internet(1) security(5) mechanisms(5) ipsec(8) isakmpOakley(1)}
|
||||
//
|
||||
|
||||
static final DERObjectIdentifier isakmpOakley = new DERObjectIdentifier("1.3.6.1.5.5.8.1");
|
||||
|
||||
static final DERObjectIdentifier hmacMD5 = new DERObjectIdentifier(isakmpOakley + ".1");
|
||||
static final DERObjectIdentifier hmacSHA1 = new DERObjectIdentifier(isakmpOakley + ".2");
|
||||
|
||||
static final DERObjectIdentifier hmacTIGER = new DERObjectIdentifier(isakmpOakley + ".3");
|
||||
|
||||
static final DERObjectIdentifier hmacRIPEMD160 = new DERObjectIdentifier(isakmpOakley + ".4");
|
||||
|
||||
}
|
||||
@@ -6,13 +6,13 @@ import java.security.Provider;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
|
||||
import org.bouncycastle.asn1.DERObjectIdentifier;
|
||||
//import org.bouncycastle.asn1.DERObjectIdentifier;
|
||||
//import org.bouncycastle.asn1.bc.BCObjectIdentifiers;
|
||||
//import org.bouncycastle.asn1.cryptopro.CryptoProObjectIdentifiers;
|
||||
import org.bouncycastle.asn1.iana.IANAObjectIdentifiers;
|
||||
//import org.bouncycastle.asn1.iana.IANAObjectIdentifiers;
|
||||
//import org.bouncycastle.asn1.nist.NISTObjectIdentifiers;
|
||||
//import org.bouncycastle.asn1.oiw.OIWObjectIdentifiers;
|
||||
import org.bouncycastle.asn1.pkcs.PKCSObjectIdentifiers;
|
||||
//import org.bouncycastle.asn1.pkcs.PKCSObjectIdentifiers;
|
||||
//import org.bouncycastle.asn1.teletrust.TeleTrusTObjectIdentifiers;
|
||||
import org.bouncycastle.jce.interfaces.ConfigurableProvider;
|
||||
|
||||
@@ -646,6 +646,7 @@ public final class BouncyCastleProvider extends Provider
|
||||
//
|
||||
private void addMacAlgorithms()
|
||||
{
|
||||
/*
|
||||
put("Mac.DESMAC", "org.bouncycastle.jce.provider.JCEMac$DES");
|
||||
put("Alg.Alias.Mac.DES", "DESMAC");
|
||||
put("Mac.DESMAC/CFB8", "org.bouncycastle.jce.provider.JCEMac$DESCFB8");
|
||||
@@ -726,8 +727,10 @@ public final class BouncyCastleProvider extends Provider
|
||||
put("Mac.PBEWITHHMACSHA1", "org.bouncycastle.jce.provider.JCEMac$PBEWithSHA");
|
||||
put("Mac.PBEWITHHMACRIPEMD160", "org.bouncycastle.jce.provider.JCEMac$PBEWithRIPEMD160");
|
||||
put("Alg.Alias.Mac.1.3.14.3.2.26", "PBEWITHHMACSHA");
|
||||
*/
|
||||
}
|
||||
|
||||
/*
|
||||
private void addHMACAlgorithm(
|
||||
String algorithm,
|
||||
String algorithmClassName,
|
||||
@@ -752,6 +755,7 @@ public final class BouncyCastleProvider extends Provider
|
||||
put("Alg.Alias.Mac." + oid, mainName);
|
||||
put("Alg.Alias.KeyGenerator." + oid, mainName);
|
||||
}
|
||||
*/
|
||||
|
||||
//
|
||||
// message digests
|
||||
|
||||
Reference in new issue
Block a user