2021-08-22 23:55:33 +08:00
|
|
|
//go:build !openssl
|
2019-05-23 01:31:11 +08:00
|
|
|
// +build !openssl
|
|
|
|
|
|
|
|
package crypto
|
|
|
|
|
|
|
|
import (
|
|
|
|
"io"
|
|
|
|
|
2022-08-18 23:54:48 +08:00
|
|
|
"github.com/libp2p/go-libp2p/core/crypto"
|
2019-05-23 01:31:11 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
// RsaPrivateKey is an rsa private key
|
2022-08-18 23:54:48 +08:00
|
|
|
// Deprecated: use github.com/libp2p/go-libp2p/core/crypto.RsaPrivateKey instead
|
|
|
|
type RsaPrivateKey = crypto.RsaPrivateKey
|
2019-05-23 01:31:11 +08:00
|
|
|
|
|
|
|
// RsaPublicKey is an rsa public key
|
2022-08-18 23:54:48 +08:00
|
|
|
// Deprecated: use github.com/libp2p/go-libp2p/core/crypto.RsaPublicKey instead
|
|
|
|
type RsaPublicKey = crypto.RsaPublicKey
|
2019-05-23 01:31:11 +08:00
|
|
|
|
|
|
|
// GenerateRSAKeyPair generates a new rsa private and public key
|
2022-08-18 23:54:48 +08:00
|
|
|
// Deprecated: use github.com/libp2p/go-libp2p/core/crypto.GenerateRSAKeyPair
|
2019-05-23 01:31:11 +08:00
|
|
|
func GenerateRSAKeyPair(bits int, src io.Reader) (PrivKey, PubKey, error) {
|
2022-08-18 23:54:48 +08:00
|
|
|
return crypto.GenerateRSAKeyPair(bits, src)
|
2019-05-23 01:31:11 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// UnmarshalRsaPrivateKey returns a private key from the input x509 bytes
|
2022-08-18 23:54:48 +08:00
|
|
|
// Deprecated: use github.com/libp2p/go-libp2p/core/crypto.UnmarshalRsaPrivateKey
|
2022-04-19 03:40:37 +08:00
|
|
|
func UnmarshalRsaPrivateKey(b []byte) (key PrivKey, err error) {
|
2022-08-18 23:54:48 +08:00
|
|
|
return crypto.UnmarshalRsaPrivateKey(b)
|
2019-05-23 01:31:11 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// UnmarshalRsaPublicKey returns a public key from the input x509 bytes
|
2022-08-18 23:54:48 +08:00
|
|
|
// Deprecated: use github.com/libp2p/go-libp2p/core/crypto.UnmarshalRsaPublicKey
|
2022-04-19 03:40:37 +08:00
|
|
|
func UnmarshalRsaPublicKey(b []byte) (key PubKey, err error) {
|
2022-08-18 23:54:48 +08:00
|
|
|
return crypto.UnmarshalRsaPublicKey(b)
|
2019-05-23 01:31:11 +08:00
|
|
|
}
|