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) AppendError(err ...error) EdDSA
- func (this EdDSA) CreateKdfPrivateKeyWithPassword(password string, opts ...any) EdDSA
- func (this EdDSA) CreatePbePrivateKeyWithPassword(password string, alg string) EdDSA
- func (this EdDSA) CreatePrivateKey() EdDSA
- func (this EdDSA) CreatePrivateKeyWithPassword(password string, opts ...any) EdDSA
- func (this EdDSA) CreatePublicKey() EdDSA
- func (this EdDSA) Error() cryptobin_tool.Errors
- 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) GetErrors() []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) WithErrors(errs []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 ( // 获取 Cipher 类型 GetCipherFromName = cryptobin_pkcs8.GetCipherFromName // 获取 hash 类型 GetHashFromName = cryptobin_pkcs8.GetHashFromName )
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 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 { // 错误 Errors []error // contains filtered or unexported fields }
*
- EdDSA *
- @create 2022-4-3
- @author deatil
func FromPrivateKeyWithPassword ¶ added in v1.0.1018
私钥
func (EdDSA) AppendError ¶ added in v1.0.1026
添加错误
func (EdDSA) CreateKdfPrivateKeyWithPassword ¶ added in v1.0.1022
生成私钥带密码 pem 数据 CreateKdfPrivateKeyWithPassword("123", "AES256CBC", "SHA256")
func (EdDSA) CreatePbePrivateKeyWithPassword ¶ added in v1.0.1022
生成 PKCS8 私钥带密码 pem 数据
func (EdDSA) CreatePrivateKey ¶
生成私钥 pem 数据 使用: obj := New().GenerateKey() priKey := obj.CreatePrivateKey().ToKeyString()
func (EdDSA) CreatePrivateKeyWithPassword ¶
生成 PKCS8 私钥带密码 pem 数据 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.