35 lines
918 B
Go
35 lines
918 B
Go
package starcrypto
|
|
|
|
import (
|
|
"b612.me/starcrypto/asymm"
|
|
"crypto"
|
|
)
|
|
|
|
func EncodePrivateKey(private crypto.PrivateKey, secret string) ([]byte, error) {
|
|
return asymm.EncodePrivateKey(private, secret)
|
|
}
|
|
|
|
func EncodePublicKey(public crypto.PublicKey) ([]byte, error) {
|
|
return asymm.EncodePublicKey(public)
|
|
}
|
|
|
|
func DecodePrivateKey(private []byte, password string) (crypto.PrivateKey, error) {
|
|
return asymm.DecodePrivateKey(private, password)
|
|
}
|
|
|
|
func EncodeOpenSSHPrivateKey(private crypto.PrivateKey, secret string) ([]byte, error) {
|
|
return asymm.EncodeOpenSSHPrivateKey(private, secret)
|
|
}
|
|
|
|
func DecodePublicKey(pubStr []byte) (crypto.PublicKey, error) {
|
|
return asymm.DecodePublicKey(pubStr)
|
|
}
|
|
|
|
func EncodeSSHPublicKey(public crypto.PublicKey) ([]byte, error) {
|
|
return asymm.EncodeSSHPublicKey(public)
|
|
}
|
|
|
|
func DecodeSSHPublicKey(pubStr []byte) (crypto.PublicKey, error) {
|
|
return asymm.DecodeSSHPublicKey(pubStr)
|
|
}
|