Methods Summary |
---|
public boolean | equals(java.lang.Object o)
if (!(o instanceof RSAPrivateKey))
{
return false;
}
if (o == this)
{
return true;
}
RSAPrivateKey key = (RSAPrivateKey)o;
return getModulus().equals(key.getModulus())
&& getPrivateExponent().equals(key.getPrivateExponent());
|
public java.lang.String | getAlgorithm()
return "RSA";
|
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 null;
|
public java.lang.String | getFormat()
return "NULL";
|
public java.math.BigInteger | getModulus()
return modulus;
|
public java.math.BigInteger | getPrivateExponent()
return privateExponent;
|
public int | hashCode()
return getModulus().hashCode() ^ getPrivateExponent().hashCode();
|
private void | readObject(java.io.ObjectInputStream in)
this.modulus = (BigInteger)in.readObject();
Object obj = in.readObject();
if (obj instanceof Hashtable)
{
this.pkcs12Attributes = (Hashtable)obj;
this.pkcs12Ordering = (Vector)in.readObject();
}
else
{
this.pkcs12Attributes = new Hashtable();
this.pkcs12Ordering = new Vector();
ASN1InputStream aIn = new ASN1InputStream((byte[])obj);
DERObjectIdentifier oid;
while ((oid = (DERObjectIdentifier)aIn.readObject()) != null)
{
this.setBagAttribute(oid, aIn.readObject());
}
}
this.privateExponent = (BigInteger)in.readObject();
|
public void | setBagAttribute(org.bouncycastle.asn1.DERObjectIdentifier oid, org.bouncycastle.asn1.DEREncodable attribute)
pkcs12Attributes.put(oid, attribute);
pkcs12Ordering.addElement(oid);
|
private void | writeObject(java.io.ObjectOutputStream out)
out.writeObject(modulus);
if (pkcs12Ordering.size() == 0)
{
out.writeObject(pkcs12Attributes);
out.writeObject(pkcs12Ordering);
}
else
{
ByteArrayOutputStream bOut = new ByteArrayOutputStream();
ASN1OutputStream aOut = new ASN1OutputStream(bOut);
Enumeration e = this.getBagAttributeKeys();
while (e.hasMoreElements())
{
DEREncodable oid = (DEREncodable)e.nextElement();
aOut.writeObject(oid);
aOut.writeObject(pkcs12Attributes.get(oid));
}
out.writeObject(bOut.toByteArray());
}
out.writeObject(privateExponent);
|