diff --git a/xed25519.cpp b/xed25519.cpp index 7fffa83f..b59a47bb 100644 --- a/xed25519.cpp +++ b/xed25519.cpp @@ -664,8 +664,11 @@ ed25519Signer::ed25519Signer(const Integer &x) } ed25519Signer::ed25519Signer(const PKCS8PrivateKey &key) - : m_key(dynamic_cast(key)) { + // Load all fields from the other key + ByteQueue queue; + key.Save(queue); + AccessPrivateKey().Load(queue); } ed25519Signer::ed25519Signer(RandomNumberGenerator &rng) @@ -855,8 +858,11 @@ ed25519Verifier::ed25519Verifier(const Integer &y) } ed25519Verifier::ed25519Verifier(const X509PublicKey &key) - : m_key(dynamic_cast(key)) { + // Load all fields from the other key + ByteQueue queue; + key.Save(queue); + AccessPublicKey().Load(queue); } ed25519Verifier::ed25519Verifier(BufferedTransformation ¶ms)