ed521

package
v1.1.1012 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SchemeED521   = ed521.ED521
	SchemeED521Ph = ed521.ED521Ph
)

Variables

View Source
var (
	// 获取 Cipher 类型
	GetCipherFromName = pkcs8.GetCipherFromName
	// 获取 hash 类型
	GetHashFromName = pkcs8.GetHashFromName
)
View Source
var (
	ErrKeyMustBePEMEncoded = errors.New("go-cryptobin/ed521: invalid key: Key must be a PEM encoded PKCS8 key")
	ErrNotEdPrivateKey     = errors.New("go-cryptobin/ed521: key is not a valid ED521 private key")
	ErrNotEdPublicKey      = errors.New("go-cryptobin/ed521: key is not a valid ED521 public key")
)

Functions

This section is empty.

Types

type ED521

type ED521 struct {

	// error list
	Errors []error
	// contains filtered or unexported fields
}

*

  • ED521 *
  • @create 2025-12-2
  • @author deatil

func FromBase64String

func FromBase64String(data string) ED521

Base64

func FromBytes

func FromBytes(data []byte) ED521

字节

func FromHexString

func FromHexString(data string) ED521

Hex

func FromPrivateKey

func FromPrivateKey(key []byte) ED521

私钥

func FromPrivateKeySeed

func FromPrivateKeySeed(seed []byte) ED521

私钥 Seed

func FromPrivateKeyWithPassword

func FromPrivateKeyWithPassword(key []byte, password string) ED521

私钥

func FromPublicKey

func FromPublicKey(key []byte) ED521

公钥

func FromString

func FromString(data string) ED521

字符

func GenerateKey

func GenerateKey() ED521

GenerateKey

func GenerateKeyWithSeed

func GenerateKeyWithSeed(reader io.Reader) ED521

GenerateKey

func New

func New() ED521

NewED521

func NewED521

func NewED521() ED521

NewED521

func (ED521) AppendError

func (this ED521) AppendError(err ...error) ED521

append error

func (ED521) CheckKeyPair

func (this ED521) CheckKeyPair() bool

Check KeyPair

func (ED521) CreatePrivateKey

func (this ED521) CreatePrivateKey() ED521

生成私钥 pem 数据 Create PrivateKey PEM data

func (ED521) CreatePrivateKeyWithPassword

func (this ED521) CreatePrivateKeyWithPassword(password string, opts ...any) ED521

生成 PKCS8 私钥带密码 pem 数据 CreatePrivateKeyWithPassword("123", "AES256CBC", "SHA256")

func (ED521) CreatePublicKey

func (this ED521) CreatePublicKey() ED521

生成公钥 pem 数据

func (ED521) Error

func (this ED521) Error() error

return error

func (ED521) FromBase64String

func (this ED521) FromBase64String(data string) ED521

Base64

func (ED521) FromBytes

func (this ED521) FromBytes(data []byte) ED521

字节

func (ED521) FromHexString

func (this ED521) FromHexString(data string) ED521

Hex

func (ED521) FromPrivateKey

func (this ED521) FromPrivateKey(key []byte) ED521

私钥

func (ED521) FromPrivateKeyDer

func (this ED521) FromPrivateKeyDer(der []byte) ED521

DER 私钥

func (ED521) FromPrivateKeySeed

func (this ED521) FromPrivateKeySeed(seed []byte) ED521

私钥 Seed

func (ED521) FromPrivateKeyString

func (this ED521) FromPrivateKeyString(keyString string) ED521

PrivateKey hex string private-key: 07e4********;

func (ED521) FromPrivateKeyWithPassword

func (this ED521) FromPrivateKeyWithPassword(key []byte, password string) ED521

私钥带密码

func (ED521) FromPublicKey

func (this ED521) FromPublicKey(key []byte) ED521

公钥

func (ED521) FromPublicKeyDer

func (this ED521) FromPublicKeyDer(der []byte) ED521

DER 公钥

func (ED521) FromPublicKeyString

func (this ED521) FromPublicKeyString(keyString string) ED521

PublicKey hex string

func (ED521) FromString

func (this ED521) FromString(data string) ED521

字符

func (ED521) GenerateKey

func (this ED521) GenerateKey() ED521

GenerateKey

func (ED521) GenerateKeyWithSeed

func (this ED521) GenerateKeyWithSeed(reader io.Reader) ED521

GenerateKey

func (ED521) GetData

func (this ED521) GetData() []byte

获取 data

func (ED521) GetErrors

func (this ED521) GetErrors() []error

获取错误

func (ED521) GetKeyData

func (this ED521) GetKeyData() []byte

获取 keyData

func (ED521) GetOptions

func (this ED521) GetOptions() *Options

获取 Options

func (ED521) GetParsedData

func (this ED521) GetParsedData() []byte

获取 parsedData

func (ED521) GetPrivateKey

func (this ED521) GetPrivateKey() *ed521.PrivateKey

获取 PrivateKey

func (ED521) GetPrivateKeySeed

func (this ED521) GetPrivateKeySeed() []byte

获取 PrivateKeySeed

func (ED521) GetPrivateKeySeedString

func (this ED521) GetPrivateKeySeedString() string

获取 PrivateKeySeed

func (ED521) GetPrivateKeyString

func (this ED521) GetPrivateKeyString() string

get PrivateKey data hex string

func (ED521) GetPublicKey

func (this ED521) GetPublicKey() *ed521.PublicKey

获取 PublicKey

func (ED521) GetPublicKeyString

func (this ED521) GetPublicKeyString() string

get PublicKey data hex string

func (ED521) GetVerify

func (this ED521) GetVerify() bool

获取验证后情况

func (ED521) MakeKeyDer

func (this ED521) MakeKeyDer() ED521

生成密钥 der 数据

func (ED521) MakePublicKey

func (this ED521) MakePublicKey() ED521

生成公钥

func (ED521) OnError

func (this ED521) OnError(fn func([]error)) ED521

func (ED521) ParsePrivateKeyFromPEM

func (this ED521) ParsePrivateKeyFromPEM(key []byte) (crypto.PrivateKey, error)

解析私钥

func (ED521) ParsePrivateKeyFromPEMWithPassword

func (this ED521) ParsePrivateKeyFromPEMWithPassword(key []byte, password string) (crypto.PrivateKey, error)

解析私钥带密码

func (ED521) ParsePublicKeyFromPEM

func (this ED521) ParsePublicKeyFromPEM(key []byte) (crypto.PublicKey, error)

解析公钥

func (ED521) SetOptions

func (this ED521) SetOptions(name string, context ...string) ED521

设置 options 可用类型 [ED521Ph | ED521]

func (ED521) Sign

func (this ED521) Sign() ED521

私钥签名

func (ED521) ToBase64String

func (this ED521) ToBase64String() string

输出Base64

func (ED521) ToBytes

func (this ED521) ToBytes() []byte

输出字节

func (ED521) ToHexString

func (this ED521) ToHexString() string

输出Hex

func (ED521) ToKeyBytes

func (this ED521) ToKeyBytes() []byte

私钥/公钥

func (ED521) ToKeyString

func (this ED521) ToKeyString() string

私钥/公钥

func (ED521) ToString

func (this ED521) ToString() string

输出字符

func (ED521) ToVerify

func (this ED521) ToVerify() bool

验证结果

func (ED521) ToVerifyInt

func (this ED521) ToVerifyInt() int

验证结果,返回 int 类型

func (ED521) Verify

func (this ED521) Verify(data []byte) ED521

公钥验证

func (ED521) WithData

func (this ED521) WithData(data []byte) ED521

设置 data

func (ED521) WithErrors

func (this ED521) WithErrors(errs []error) ED521

设置错误

func (ED521) WithOptions

func (this ED521) WithOptions(op *Options) ED521

设置 options

func (ED521) WithParsedData

func (this ED521) WithParsedData(data []byte) ED521

设置 parsedData

func (ED521) WithPrivateKey

func (this ED521) WithPrivateKey(data *ed521.PrivateKey) ED521

设置 PrivateKey

func (ED521) WithPublicKey

func (this ED521) WithPublicKey(data *ed521.PublicKey) ED521

设置 PublicKey

func (ED521) WithVerify

func (this ED521) WithVerify(data bool) ED521

设置 verify

type Options

type Options = ed521.Options

设置

type Opts

type Opts = pkcs8.Opts

配置

type PBKDF2Opts

type PBKDF2Opts = pkcs8.PBKDF2Opts

PBKDF2 配置

type ScryptOpts

type ScryptOpts = pkcs8.ScryptOpts

Scrypt 配置

Jump to

Keyboard shortcuts

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