dsa

package
v1.1.8 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package dsa provides dsa crypto related implementations.

Package dsa provides dsa crypto related implementations.

Package dsa provides dsa crypto related implementations.

Package dsa provides dsa crypto related implementations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KeyPair

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

KeyPair is struct that provides key pair related methods.

func (*KeyPair) Generate

func (this *KeyPair) Generate(parameterSizes dsa.ParameterSizes) error

Generate is to generate a key pair.

ex) err := keyPair.Generate(crypto_dsa.L1024N160)

func (*KeyPair) GetKeyPair

func (this *KeyPair) GetKeyPair() (privateKey PrivateKey, publicKey PublicKey)

GetKeyPair is to get a key pair.

ex) privateKey, publicKey := keyPair.GetKeyPair()

func (*KeyPair) SetKeyPair

func (this *KeyPair) SetKeyPair(privateKey PrivateKey, publicKey PublicKey)

SetKeyPair is to set a key pair.

ex) keyPair.SetKeyPair(privateKey, publicKey)

func (*KeyPair) Sign

func (this *KeyPair) Sign(message string) (Signature, error)

Sign is create a signature for message.

ex) signature, err := keyPair.Sign(message)

func (*KeyPair) Verify

func (this *KeyPair) Verify(message string, signature Signature) bool

Verify is verifies the signature.

ex) result := keyPair.Verify(message, signature)

type PrivateKey

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

PrivateKey is struct that provides private key related methods.

func (*PrivateKey) Get

func (this *PrivateKey) Get() *dsa.PrivateKey

Get is to get a *dsa.PrivateKey.

ex) key := privateKey.Get()

func (*PrivateKey) GetPemAsn1

func (this *PrivateKey) GetPemAsn1() (string, error)

GetPemAsn1 is to get a string in Pem/Asn1 format.

ex) pemAsn1, err := privateKey.GetPemAsn1()

func (*PrivateKey) GetPublicKey

func (this *PrivateKey) GetPublicKey() PublicKey

GetPublicKey is to get a PublicKey.

ex) key := privateKey.GetPublicKey()

func (*PrivateKey) Set

func (this *PrivateKey) Set(privateKey *dsa.PrivateKey)

Set is to set a *dsa.PrivateKey.

ex) privateKey.Set(key)

func (*PrivateKey) SetPemAsn1

func (this *PrivateKey) SetPemAsn1(pemAsn1 string) error

SetPemAsn1 is to set the primary key using a string in Pem/Asn1 format.

ex) err := privateKey.SetPemAsn1(pemAsn1)

func (*PrivateKey) SetSizes

func (this *PrivateKey) SetSizes(parameterSizes dsa.ParameterSizes) error

SetSizes is to set the primary key using sizes.

ex) err := privateKey.SetSizes(crypto_dsa.L1024N160)

func (*PrivateKey) Sign

func (this *PrivateKey) Sign(message string) (Signature, error)

Sign is create a signature for message.

ex) signature, err := privateKey.Sign(message)

func (*PrivateKey) Verify

func (this *PrivateKey) Verify(message string, signature Signature) bool

Verify is verifies the signature.

ex) result := privateKey.Verify(message, signature)

type PublicKey

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

PublicKey is struct that provides public key related methods.

func (*PublicKey) Get

func (this *PublicKey) Get() dsa.PublicKey

Get is to get a dsa.PublicKey.

ex) key := publicKey.Get()

func (*PublicKey) GetPemAsn1

func (this *PublicKey) GetPemAsn1() (string, error)

GetPemAsn1 is to get a string in Pem/Asn1 format.

ex) pemAsn1, err := publicKey.GetPemAsn1()

func (*PublicKey) GetSsh

func (this *PublicKey) GetSsh() (string, error)

GetSsh is to get a string in ssh format.

ex) sshKey, err := publicKey.GetSsh()

func (*PublicKey) GetSshPublicKey

func (this *PublicKey) GetSshPublicKey() (ssh.PublicKey, error)

GetSshPublicKey is to get a ssh.PublicKey.

ex) key, err := publicKey.GetSshPublicKey()

func (*PublicKey) Set

func (this *PublicKey) Set(publicKey dsa.PublicKey)

Set is to set a dsa.PublicKey.

ex) publicKey.Set(key)

func (*PublicKey) SetPemAsn1

func (this *PublicKey) SetPemAsn1(pemAsn1 string) error

SetPemAsn1 is to set the public key using a string in Pem/Asn1 format.

ex) err := publicKey.SetPemAsn1(pemAsn1)

func (*PublicKey) SetSsh

func (this *PublicKey) SetSsh(sshKey string) error

SetSsh is to set the public key using a string in ssh format.

ex) err := publicKey.SetSsh(sshKey)

func (*PublicKey) SetSshPublicKey

func (this *PublicKey) SetSshPublicKey(publicKey ssh.PublicKey) error

SetSshPublicKey is to set the public key using ssh.PublicKey.

ex) err := publicKey.SetSshPublicKey(key)

func (*PublicKey) Verify

func (this *PublicKey) Verify(message string, signature Signature) bool

Verify is verifies the signature.

ex) result := publicKey.Verify(message, signature)

type Signature

type Signature struct {
	R *big.Int
	S *big.Int
}

Signature is dsa signature

Jump to

Keyboard shortcuts

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