crypto

package
v0.5.9 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KeyType

type KeyType byte

type PublicKey

type PublicKey struct {
	// contains filtered or unexported fields
}

func PublicKeyFromString

func PublicKeyFromString(publicKeyStr string) (*PublicKey, error)

func (*PublicKey) EncryptKey

func (publicKey *PublicKey) EncryptKey(secretKey SecretKey) (wrappedKey *WrappedKey, err error)

func (*PublicKey) EncryptSecret

func (publicKey *PublicKey) EncryptSecret(secret []byte, hashEnabled bool) (sealedSecret *SealedSecret, err error)

func (PublicKey) String

func (publicKey PublicKey) String() (string, error)

func (*PublicKey) Type

func (publicKey *PublicKey) Type() KeyType

type SealedSecret

type SealedSecret struct {
	// contains filtered or unexported fields
}

func (SealedSecret) EncryptedAt

func (ciph SealedSecret) EncryptedAt() time.Time

func (SealedSecret) EncryptedBy

func (ciph SealedSecret) EncryptedBy() []byte

func (SealedSecret) EncryptedByPublicKey

func (ciph SealedSecret) EncryptedByPublicKey() (*PublicKey, error)

func (*SealedSecret) FromString

func (sealedSecret *SealedSecret) FromString(sealedSecretStr string) (err error)

func (*SealedSecret) Hash

func (sealedSecret *SealedSecret) Hash() string

func (SealedSecret) IsEncryptedBy

func (ciph SealedSecret) IsEncryptedBy(publicKey *PublicKey) bool

func (SealedSecret) String

func (sealedSecret SealedSecret) String() string

type SecretKey

type SecretKey struct {
	// contains filtered or unexported fields
}

func NewSecretKey

func NewSecretKey(keyType KeyType) (secretKey *SecretKey, err error)

func NewSecretKeyForPassword

func NewSecretKeyForPassword(password []byte, keyType KeyType) (secretKey *SecretKey, err error)

func SecretKeyFromBytes

func SecretKeyFromBytes(bytes []byte) (*SecretKey, error)

func SecretKeyFromString

func SecretKeyFromString(secretKeyStr string) (*SecretKey, error)

func (*SecretKey) Bytes

func (secretKey *SecretKey) Bytes() ([]byte, error)

func (*SecretKey) DecryptKey

func (secretKey *SecretKey) DecryptKey(wrappedKey WrappedKey) (*SecretKey, error)

func (*SecretKey) DecryptSecret

func (secretKey *SecretKey) DecryptSecret(sealedSecret SealedSecret) (secret []byte, err error)

func (*SecretKey) IsSerializationRestricted added in v0.5.2

func (secretKey *SecretKey) IsSerializationRestricted() bool

func (*SecretKey) PublicKey

func (secretKey *SecretKey) PublicKey(postQuantum bool) (publicKey *PublicKey, err error)

func (*SecretKey) RestrictSerialization added in v0.5.2

func (secretKey *SecretKey) RestrictSerialization()

func (SecretKey) String

func (secretKey SecretKey) String() string

type WrappedKey

type WrappedKey struct {
	// contains filtered or unexported fields
}

func (WrappedKey) EncryptedAt

func (ciph WrappedKey) EncryptedAt() time.Time

func (WrappedKey) EncryptedBy

func (ciph WrappedKey) EncryptedBy() []byte

func (WrappedKey) EncryptedByPublicKey

func (ciph WrappedKey) EncryptedByPublicKey() (*PublicKey, error)

func (*WrappedKey) FromString

func (wrappedKey *WrappedKey) FromString(wrappedKeyStr string) (err error)

func (WrappedKey) IsEncryptedBy

func (ciph WrappedKey) IsEncryptedBy(publicKey *PublicKey) bool

func (WrappedKey) String

func (wrappedKey WrappedKey) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳