I am working on both encryption methods and want to convert the ECDSA key to RSA key and vice versa.
Is there any way of converting ECDSA key to RSA key, and vice-versa as well in Go language?
Asked Answered
ECDSA and RSA are different algorithms that are not compatible. The same applies to the keys, which therefore cannot be converted. This applies in general and not only to Go. –
Usance
No, there isn't. ECDSA and RSA are completely different and can't be converted. ECDSA is an elliptic-curve algorithm based on the elliptic-curve discrete logarithm problem, and RSA is a finite-field algorithm based on the factoring problem. In addition, RSA can be used for signing and encryption, and ECDSA can only sign.
If you want your code to handle both, you'll need to have two separate code paths, one for ECDSA and one for RSA.
© 2022 - 2024 — McMap. All rights reserved.