Documentation ¶
Index ¶
- Constants
- type MARSigner
- func (s *MARSigner) Config() signer.Configuration
- func (s *MARSigner) GetDefaultOptions() interface{}
- func (s *MARSigner) SignData(data []byte, options interface{}) (signer.Signature, error)
- func (s *MARSigner) SignFile(input []byte, options interface{}) (signer.SignedFile, error)
- func (s *MARSigner) SignHash(hashed []byte, options interface{}) (signer.Signature, error)
- type Options
- type Signature
Constants ¶
const (
// Type of this signer is "mar"
Type = "mar"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MARSigner ¶
type MARSigner struct { signer.Configuration // contains filtered or unexported fields }
MARSigner holds the configuration of the signer
func New ¶
func New(conf signer.Configuration) (s *MARSigner, err error)
New initializes a mar signer using a configuration
func (*MARSigner) Config ¶
func (s *MARSigner) Config() signer.Configuration
Config returns the configuration of the current signer
func (*MARSigner) GetDefaultOptions ¶
func (s *MARSigner) GetDefaultOptions() interface{}
GetDefaultOptions returns default options of the signer
func (*MARSigner) SignData ¶
SignData takes a MAR file already marshalled for signature and returns a base64 encoded signature.
This function expects the caller to handle parsing of the MAR file, which can be really tricky because the signature headers need to be placed in the file prior to marshalling it for signature. You should consider calling the SignFile interface instead, which will handle all that magic for you.
type Options ¶
type Options struct { // SigAlg is an integer that represents the type of signature requested. // It must map the SigAlg constants from the MAR package SigAlg uint32 `json:"sigalg"` }
Options accepts the name of the signature algorithm used by the SignData interface to decide which algorithm to sign the data with
func GetOptions ¶
GetOptions takes a input interface and reflects it into a struct of options