apprsa

package
v1.1.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 24, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const BITS = 2048 // 密钥长度 1024 2048

Variables

This section is empty.

Functions

func Base64DecodeString

func Base64DecodeString(encode string) (pubKey []byte, err error)

Base64DecodeString BASE64解码

func Base64EncodeString

func Base64EncodeString(pubPEM []byte) (basePubKey string)

Base64EncodeString BASE64编码

func DecodingByPrivateKey

func DecodingByPrivateKey(privateKey string, result []byte) (decodeStr []byte, err error)

DecodingByPrivateKey 私钥解密

func ExportPrivateKeyAsPEM

func ExportPrivateKeyAsPEM(privateKey *rsa.PrivateKey) []byte

ExportPrivateKeyAsPEM 将 RSA 私钥导出为 PEM 格式

func ExportPublicKeyAsPEM

func ExportPublicKeyAsPEM(publicKey *rsa.PublicKey) []byte

ExportPublicKeyAsPEM 将 RSA 公钥导出为 PEM 格式

func GenerateRSAKey

func GenerateRSAKey() (*rsa.PrivateKey, *rsa.PublicKey)

GenerateRSAKey 生成 RSA 密钥对

func GetPublicKeyFromPriKey

func GetPublicKeyFromPriKey(privKey []byte) *rsa.PublicKey

GetPublicKeyFromPriKey 通过密钥获取公钥

func LoadPrivateKey

func LoadPrivateKey(privPEM []byte) *rsa.PrivateKey

LoadPrivateKey 加载 RSA 私钥

func LoadPublicKey

func LoadPublicKey(pubPEM []byte) *rsa.PublicKey

LoadPublicKey 加载 RSA 公钥

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL