Documentation
¶
Index ¶
- func GenerateKeysFromSeed(seedData []byte, bits int) (*rsa.PrivateKey, *rsa.PublicKey, error)
- func PublicKeyToBytes(pubKey *rsa.PublicKey) ([]byte, error)
- func SignData(privateKey *rsa.PrivateKey, data []byte) ([]byte, error)
- func VerifySignature(publicKey *rsa.PublicKey, data []byte, signature []byte) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateKeysFromSeed ¶
GenerateKeysFromSeed 使用种子数据生成 RSA 密钥对 参数:
- seedData: 用于生成密钥的种子数据
- bits: RSA 密钥的位数
返回值:
- *rsa.PrivateKey: 生成的私钥
- *rsa.PublicKey: 生成的公钥
- error: 如果生成过程中出现错误,返回相应的错误信息
func PublicKeyToBytes ¶
PublicKeyToBytes 使用 x509 标准将公钥转换为字节 参数:
- pubKey: 要转换的 RSA 公钥
返回值:
- []byte: 转换后的公钥字节
- error: 如果转换过程中出现错误,返回相应的错误信息
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.