dsa

package
v1.0.4030 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// 默认为 pkcs1 模式
	MarshalPublicKey = MarshalPKCS1PublicKey
	ParsePublicKey   = ParsePKCS1PublicKey

	MarshalPrivateKey = MarshalPKCS1PrivateKey
	ParsePrivateKey   = ParsePKCS1PrivateKey
)

Functions

func MarshalPKCS1PrivateKey

func MarshalPKCS1PrivateKey(key *dsa.PrivateKey) ([]byte, error)

包装私钥

func MarshalPKCS1PublicKey

func MarshalPKCS1PublicKey(key *dsa.PublicKey) ([]byte, error)

包装公钥

func MarshalPKCS8PrivateKey

func MarshalPKCS8PrivateKey(key *dsa.PrivateKey) ([]byte, error)

PKCS8 包装私钥

func MarshalPKCS8PublicKey

func MarshalPKCS8PublicKey(pub *dsa.PublicKey) ([]byte, error)

PKCS8 包装公钥

func MarshalXMLPrivateKey

func MarshalXMLPrivateKey(key *dsa.PrivateKey) ([]byte, error)

func MarshalXMLPublicKey

func MarshalXMLPublicKey(key *dsa.PublicKey) ([]byte, error)

func ParsePKCS1PrivateKey

func ParsePKCS1PrivateKey(derBytes []byte) (*dsa.PrivateKey, error)

解析私钥

func ParsePKCS1PublicKey

func ParsePKCS1PublicKey(derBytes []byte) (*dsa.PublicKey, error)

解析公钥

func ParsePKCS8PrivateKey

func ParsePKCS8PrivateKey(derBytes []byte) (key *dsa.PrivateKey, err error)

PKCS8 解析私钥

func ParsePKCS8PublicKey

func ParsePKCS8PublicKey(derBytes []byte) (*dsa.PublicKey, error)

PKCS8 解析公钥

func ParseXMLPrivateKey

func ParseXMLPrivateKey(der []byte) (*dsa.PrivateKey, error)

func ParseXMLPublicKey

func ParseXMLPublicKey(der []byte) (*dsa.PublicKey, error)

Types

type PKCS1Key

type PKCS1Key struct{}

*

  • dsa pkcs1 密钥 *
  • @create 2022-3-19
  • @author deatil

func NewPKCS1Key

func NewPKCS1Key() PKCS1Key

构造函数

func (PKCS1Key) MarshalPrivateKey

func (this PKCS1Key) MarshalPrivateKey(key *dsa.PrivateKey) ([]byte, error)

包装私钥

func (PKCS1Key) MarshalPublicKey

func (this PKCS1Key) MarshalPublicKey(key *dsa.PublicKey) ([]byte, error)

包装公钥

func (PKCS1Key) ParsePrivateKey

func (this PKCS1Key) ParsePrivateKey(derBytes []byte) (*dsa.PrivateKey, error)

解析私钥

func (PKCS1Key) ParsePublicKey

func (this PKCS1Key) ParsePublicKey(derBytes []byte) (*dsa.PublicKey, error)

解析公钥

type PKCS8Key

type PKCS8Key struct{}

*

  • dsa pkcs8 密钥 *
  • @create 2022-3-19
  • @author deatil

func NewPKCS8Key

func NewPKCS8Key() PKCS8Key

构造函数

func (PKCS8Key) MarshalPrivateKey

func (this PKCS8Key) MarshalPrivateKey(key *dsa.PrivateKey) ([]byte, error)

PKCS8 包装私钥

func (PKCS8Key) MarshalPublicKey

func (this PKCS8Key) MarshalPublicKey(key *dsa.PublicKey) ([]byte, error)

PKCS8 包装公钥

func (PKCS8Key) ParsePrivateKey

func (this PKCS8Key) ParsePrivateKey(der []byte) (key *dsa.PrivateKey, err error)

PKCS8 解析私钥

func (PKCS8Key) ParsePublicKey

func (this PKCS8Key) ParsePublicKey(der []byte) (*dsa.PublicKey, error)

PKCS8 解析公钥

type XMLKey

type XMLKey struct{}

*

  • dsa xml密钥 *
  • @create 2023-6-5
  • @author deatil

func NewXMLKey

func NewXMLKey() XMLKey

构造函数

func (XMLKey) MarshalPrivateKey

func (this XMLKey) MarshalPrivateKey(key *dsa.PrivateKey) ([]byte, error)

包装私钥

func (XMLKey) MarshalPublicKey

func (this XMLKey) MarshalPublicKey(key *dsa.PublicKey) ([]byte, error)

包装公钥

func (XMLKey) ParsePrivateKey

func (this XMLKey) ParsePrivateKey(data []byte) (*dsa.PrivateKey, error)

解析私钥

func (XMLKey) ParsePublicKey

func (this XMLKey) ParsePublicKey(data []byte) (*dsa.PublicKey, error)

解析公钥

Jump to

Keyboard shortcuts

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