public PrivateKeySignature(ICipherParameters pk, String hashAlgorithm)
{
this.pk = pk;
this.hashAlgorithm = DigestAlgorithms.GetDigest(DigestAlgorithms.GetAllowedDigests(hashAlgorithm));
if (pk is RsaKeyParameters)
encryptionAlgorithm = "RSA";
else if (pk is DsaKeyParameters)
encryptionAlgorithm = "DSA";
else if (pk is ECKeyParameters)
encryptionAlgorithm = "ECDSA";
else
throw new ArgumentException(MessageLocalization.GetComposedMessage("unknown.key.algorithm.1", pk.ToString()));
}