I realize this is dead code, but it's still working well for us. A couple of slight bugs that my IDE complains about:
-
SignatureAlgorithmIdentifierFactory::algoForAsymmetricCrypto() expects an object that implements AsymmetricCryptoAlgorithmIdentifier. However, none of the other object properties use this interface for their property definitions; instead they are using its parent interface AlgorithmIdentifierType. This works in practice but is technically incorrect. We changed the type for the argument to this method and it works without complaint. (A more correct fix would probably be to define the object properties in question, e.g. OneAsymmetricKey::_algo, as AsymmetricCryptoAlgorithmIdentifier, but I don't have the SME to confidently make those changes.)
-
PrivateKeyInfo::fromPEM() returns an instance of OneAsymmetricKey but most methods instead expect an instance of PrivateKeyInfo in their signatures. Since PrivateKeyInfo inherits from OneAsymmetricKey without any changes, we changed all the types in PrivateKey to expect the less-specific class. (As above, there is probably a better solution such as settling on one class or creating an interface.)
Will open a PR just for the sake of anyone else who comes across this.
See also sop/x509#10 and sop/crypto-bridge#2
I realize this is dead code, but it's still working well for us. A couple of slight bugs that my IDE complains about:
SignatureAlgorithmIdentifierFactory::algoForAsymmetricCrypto()expects an object that implementsAsymmetricCryptoAlgorithmIdentifier. However, none of the other object properties use this interface for their property definitions; instead they are using its parent interfaceAlgorithmIdentifierType. This works in practice but is technically incorrect. We changed the type for the argument to this method and it works without complaint. (A more correct fix would probably be to define the object properties in question, e.g.OneAsymmetricKey::_algo, asAsymmetricCryptoAlgorithmIdentifier, but I don't have the SME to confidently make those changes.)PrivateKeyInfo::fromPEM()returns an instance ofOneAsymmetricKeybut most methods instead expect an instance ofPrivateKeyInfoin their signatures. SincePrivateKeyInfoinherits fromOneAsymmetricKeywithout any changes, we changed all the types inPrivateKeyto expect the less-specific class. (As above, there is probably a better solution such as settling on one class or creating an interface.)Will open a PR just for the sake of anyone else who comes across this.
See also sop/x509#10 and sop/crypto-bridge#2