cartland
2014-07-18 04:24:55 UTC
I’m currently using
EncryptedPrivateKeyInfoFactory.CreateEncryptedPrivateKeyInfo(PkcsObjectIdentifiers.PbewithShaAnd40BitRC2Cbc,
password, salt, iterationCount, privateKey);
And would like to do something like
EncryptedPrivateKeyInfoFactory.CreateEncryptedPrivateKeyInfo(“PBES2_WITH_SHA256”,
password, salt, iterationCount, privateKey);
If CreateEncryptedPrivateKeyInfo cannot be used, is the intent to add this
support in at some point? What mechanism can be used currently (in 1.7)?
BTW: Is this a bug?
PbeUtilties.CreateEngine() returns an IMac object when mechanism is
“PBEwithHmac…..”.
However, CreateEncryptedPrivateKeyInfo() casts this to IBufferedCipher.
IBufferedCipher cipher = PbeUtilities.CreateEngine(algorithm) as
IBufferedCipher;
The result is cipher is null and you get a “System.NullReferenceException:
Object reference not set to an instance of an object” (because the cipher ==
null check is not implemented).
--
View this message in context: http://bouncy-castle.1462172.n4.nabble.com/Can-CreateEncryptedPrivateKeyInfo-be-used-with-pbes2-sha256-C-tp4657230.html
Sent from the Bouncy Castle - Dev mailing list archive at Nabble.com.
EncryptedPrivateKeyInfoFactory.CreateEncryptedPrivateKeyInfo(PkcsObjectIdentifiers.PbewithShaAnd40BitRC2Cbc,
password, salt, iterationCount, privateKey);
And would like to do something like
EncryptedPrivateKeyInfoFactory.CreateEncryptedPrivateKeyInfo(“PBES2_WITH_SHA256”,
password, salt, iterationCount, privateKey);
If CreateEncryptedPrivateKeyInfo cannot be used, is the intent to add this
support in at some point? What mechanism can be used currently (in 1.7)?
BTW: Is this a bug?
PbeUtilties.CreateEngine() returns an IMac object when mechanism is
“PBEwithHmac…..”.
However, CreateEncryptedPrivateKeyInfo() casts this to IBufferedCipher.
IBufferedCipher cipher = PbeUtilities.CreateEngine(algorithm) as
IBufferedCipher;
The result is cipher is null and you get a “System.NullReferenceException:
Object reference not set to an instance of an object” (because the cipher ==
null check is not implemented).
--
View this message in context: http://bouncy-castle.1462172.n4.nabble.com/Can-CreateEncryptedPrivateKeyInfo-be-used-with-pbes2-sha256-C-tp4657230.html
Sent from the Bouncy Castle - Dev mailing list archive at Nabble.com.