Mzack9999 62af038617
Add template sign/verify functionality (#3029)
* add template sign/verify functionality

* fixing syntax
2023-02-26 03:54:46 +05:30

35 lines
508 B
Go

package signer
import (
"errors"
"math/big"
"regexp"
)
type AlgorithmType uint8
const (
RSA AlgorithmType = iota
ECDSA
)
type Options struct {
PrivateKeyName string
PrivateKeyData []byte
PassphraseName string
PassphraseData []byte
PublicKeyName string
PublicKeyData []byte
Algorithm AlgorithmType
}
type EcdsaSignature struct {
R *big.Int
S *big.Int
}
var (
ReDigest = regexp.MustCompile(`(?m)^#\sdigest:\s.+$`)
ErrUnknownAlgorithm = errors.New("unknown algorithm")
)