Constructors Summary |
---|
protected JDKDSAPrivateKey()
|
JDKDSAPrivateKey(DSAPrivateKey key)
this.x = key.getX();
this.dsaSpec = key.getParams();
|
JDKDSAPrivateKey(DSAPrivateKeySpec spec)
this.x = spec.getX();
this.dsaSpec = new DSAParameterSpec(spec.getP(), spec.getQ(), spec.getG());
|
JDKDSAPrivateKey(org.bouncycastle.asn1.pkcs.PrivateKeyInfo info)
DSAParameter params = new DSAParameter((ASN1Sequence)info.getAlgorithmId().getParameters());
DERInteger derX = (DERInteger)info.getPrivateKey();
this.x = derX.getValue();
this.dsaSpec = new DSAParameterSpec(params.getP(), params.getQ(), params.getG());
|
JDKDSAPrivateKey(org.bouncycastle.crypto.params.DSAPrivateKeyParameters params)
this.x = params.getX();
this.dsaSpec = new DSAParameterSpec(params.getParameters().getP(), params.getParameters().getQ(), params.getParameters().getG());
|
Methods Summary |
---|
public boolean | equals(java.lang.Object o)
if (!(o instanceof DSAPrivateKey))
{
return false;
}
DSAPrivateKey other = (DSAPrivateKey)o;
return this.getX().equals(other.getX())
&& this.getParams().getG().equals(other.getParams().getG())
&& this.getParams().getP().equals(other.getParams().getP())
&& this.getParams().getQ().equals(other.getParams().getQ());
|
public java.lang.String | getAlgorithm()
return "DSA";
|
public org.bouncycastle.asn1.DEREncodable | getBagAttribute(org.bouncycastle.asn1.DERObjectIdentifier oid)
return (DEREncodable)pkcs12Attributes.get(oid);
|
public java.util.Enumeration | getBagAttributeKeys()
return pkcs12Ordering.elements();
|
public byte[] | getEncoded()Return a PKCS8 representation of the key. The sequence returned
represents a full PrivateKeyInfo object.
PrivateKeyInfo info = new PrivateKeyInfo(new AlgorithmIdentifier(X9ObjectIdentifiers.id_dsa, new DSAParameter(dsaSpec.getP(), dsaSpec.getQ(), dsaSpec.getG()).getDERObject()), new DERInteger(getX()));
return info.getDEREncoded();
|
public java.lang.String | getFormat()return the encoding format we produce in getEncoded().
return "PKCS#8";
|
public java.security.interfaces.DSAParams | getParams()
return dsaSpec;
|
public java.math.BigInteger | getX()
return x;
|
public void | setBagAttribute(org.bouncycastle.asn1.DERObjectIdentifier oid, org.bouncycastle.asn1.DEREncodable attribute)
pkcs12Attributes.put(oid, attribute);
pkcs12Ordering.addElement(oid);
|