Documentation ¶
Index ¶
- Variables
- type EdDSA
- func FromBase64String(data string) EdDSA
- func FromBytes(data []byte) EdDSA
- func FromHexString(data string) EdDSA
- func FromPrivateKey(key []byte) EdDSA
- func FromPrivateKeyWithPassword(key []byte, password string) EdDSA
- func FromPublicKey(key []byte) EdDSA
- func FromString(data string) EdDSA
- func GenerateKey() EdDSA
- func New() EdDSA
- func NewEdDSA() EdDSA
- func (this EdDSA) CreatePrivateKey() EdDSA
- func (this EdDSA) CreatePrivateKeyWithPassword(password string, opts ...any) EdDSA
- func (this EdDSA) CreatePublicKey() EdDSA
- func (this EdDSA) FromBase64String(data string) EdDSA
- func (this EdDSA) FromBytes(data []byte) EdDSA
- func (this EdDSA) FromHexString(data string) EdDSA
- func (this EdDSA) FromPrivateKey(key []byte) EdDSA
- func (this EdDSA) FromPrivateKeyWithPassword(key []byte, password string) EdDSA
- func (this EdDSA) FromPublicKey(key []byte) EdDSA
- func (this EdDSA) FromString(data string) EdDSA
- func (this EdDSA) GenerateKey() EdDSA
- func (this EdDSA) GetData() []byte
- func (this EdDSA) GetError() error
- func (this EdDSA) GetKeyData() []byte
- func (this EdDSA) GetParedData() []byte
- func (this EdDSA) GetPrivateKey() ed25519.PrivateKey
- func (this EdDSA) GetPublicKey() ed25519.PublicKey
- func (this EdDSA) GetVeryed() bool
- func (this EdDSA) MakePublicKey() EdDSA
- func (this EdDSA) OnError(fn EdDSAErrorFunc) EdDSA
- func (this EdDSA) ParseEdPrivateKeyFromPEM(key []byte) (crypto.PrivateKey, error)
- func (this EdDSA) ParseEdPrivateKeyFromPEMWithPassword(key []byte, password string) (crypto.PrivateKey, error)
- func (this EdDSA) ParseEdPublicKeyFromPEM(key []byte) (crypto.PublicKey, error)
- func (this EdDSA) Sign() EdDSA
- func (this EdDSA) ToBase64String() string
- func (this EdDSA) ToBytes() []byte
- func (this EdDSA) ToHexString() string
- func (this EdDSA) ToKeyBytes() []byte
- func (this EdDSA) ToKeyString() string
- func (this EdDSA) ToString() string
- func (this EdDSA) ToVeryed() bool
- func (this EdDSA) Very(data []byte) EdDSA
- func (this EdDSA) WithData(data []byte) EdDSA
- func (this EdDSA) WithError(err error) EdDSA
- func (this EdDSA) WithParedData(data []byte) EdDSA
- func (this EdDSA) WithPrivateKey(data ed25519.PrivateKey) EdDSA
- func (this EdDSA) WithPublicKey(data ed25519.PublicKey) EdDSA
- func (this EdDSA) WithVeryed(data bool) EdDSA
- type EdDSAErrorFunc
- type Opts
- type PBKDF2Opts
- type ScryptOpts
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrKeyMustBePEMEncoded = errors.New("invalid key: Key must be a PEM encoded PKCS1 or PKCS8 key") ErrNotEdPrivateKey = errors.New("key is not a valid Ed25519 private key") ErrNotEdPublicKey = errors.New("key is not a valid Ed25519 public key") )
View Source
var CipherMap = map[string]pkcs8.CipherBlock{ "DESCBC": pkcs8.DESCBC, "DESEDE3CBC": pkcs8.DESEDE3CBC, "AES128CBC": pkcs8.AES128CBC, "AES192CBC": pkcs8.AES192CBC, "AES256CBC": pkcs8.AES256CBC, }
Cipher 列表
View Source
var PEMCiphers = map[string]x509.PEMCipher{ "DESCBC": x509.PEMCipherDES, "DESEDE3CBC": x509.PEMCipher3DES, "AES128CBC": x509.PEMCipherAES128, "AES192CBC": x509.PEMCipherAES192, "AES256CBC": x509.PEMCipherAES256, }
pem 加密方式
Functions ¶
This section is empty.
Types ¶
type EdDSA ¶
type EdDSA struct { // 错误 Error error // contains filtered or unexported fields }
*
- EdDSA *
- @create 2022-4-3
- @author deatil
func FromPrivateKeyWithPassword ¶ added in v1.0.1018
私钥
func (EdDSA) CreatePrivateKeyWithPassword ¶
私钥带密码 CreatePrivateKeyWithPassword("123", "AES256CBC", "SHA256")
func (EdDSA) FromPrivateKeyWithPassword ¶
私钥带密码
func (EdDSA) ParseEdPrivateKeyFromPEM ¶
func (this EdDSA) ParseEdPrivateKeyFromPEM(key []byte) (crypto.PrivateKey, error)
解析私钥
func (EdDSA) ParseEdPrivateKeyFromPEMWithPassword ¶
func (this EdDSA) ParseEdPrivateKeyFromPEMWithPassword(key []byte, password string) (crypto.PrivateKey, error)
解析私钥带密码
func (EdDSA) ParseEdPublicKeyFromPEM ¶
解析公钥
func (EdDSA) WithPrivateKey ¶
func (this EdDSA) WithPrivateKey(data ed25519.PrivateKey) EdDSA
设置 PrivateKey
func (EdDSA) WithPublicKey ¶
设置 PublicKey
Click to show internal directories.
Click to hide internal directories.