mirror of
https://github.com/projectdiscovery/nuclei.git
synced 2025-12-29 22:23:02 +00:00
35 lines
508 B
Go
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")
|
||
|
|
)
|