Documentation
¶
Index ¶
- func CheckpointValidator(strToValidate string) bool
- func CreateRfc3161Response(ctx context.Context, req pkcs9.TimeStampReq, certChain []*x509.Certificate, ...) (*pkcs9.TimeStampResp, error)
- func FileOrURLReadCloser(ctx context.Context, url string, content []byte) (io.ReadCloser, error)
- func ParseTimestampRequest(data []byte) (*pkcs9.TimeStampReq, error)
- func PublicKey(ctx context.Context, c *client.Rekor) (*ecdsa.PublicKey, error)
- func RekorSTHValidator(strToValidate string) bool
- func SignedCheckpointValidator(strToValidate string) bool
- func TimestampRequestFromDigest(digest []byte, opts TimestampRequestOptions) (*pkcs9.TimeStampReq, error)
- func YamlConsumer() runtime.Consumer
- func YamlProducer() runtime.Producer
- type Checkpoint
- type EssCertIDv2
- type GeneralName
- type IssuerNameAndSerial
- type RekorSTH
- type SignedCheckpoint
- func (s SignedCheckpoint) MarshalText() ([]byte, error)
- func (s *SignedCheckpoint) Sign(identity string, signer crypto.Signer, opts crypto.SignerOpts) (*note.Signature, error)
- func (s SignedCheckpoint) String() string
- func (s *SignedCheckpoint) UnmarshalText(data []byte) error
- func (s SignedCheckpoint) Verify(public crypto.PublicKey) bool
- type SigningCertificateV2
- type TimestampRequestOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckpointValidator ¶ added in v0.2.0
func CreateRfc3161Response ¶ added in v0.2.0
func CreateRfc3161Response(ctx context.Context, req pkcs9.TimeStampReq, certChain []*x509.Certificate, signer signature.Signer) (*pkcs9.TimeStampResp, error)
func FileOrURLReadCloser ¶
FileOrURLReadCloser Note: caller is responsible for closing ReadCloser returned from method!
func ParseTimestampRequest ¶ added in v0.2.0
func ParseTimestampRequest(data []byte) (*pkcs9.TimeStampReq, error)
func RekorSTHValidator ¶ added in v0.2.0
func SignedCheckpointValidator ¶ added in v0.2.0
func TimestampRequestFromDigest ¶ added in v0.2.0
func TimestampRequestFromDigest(digest []byte, opts TimestampRequestOptions) (*pkcs9.TimeStampReq, error)
func YamlConsumer ¶
func YamlProducer ¶
Types ¶
type Checkpoint ¶ added in v0.2.0
type Checkpoint struct {
// Ecosystem is the ecosystem/version string
Ecosystem string
// Size is the number of entries in the log at this checkpoint.
Size uint64
// Hash is the hash which commits to the contents of the entire log.
Hash []byte
// OtherContent is any additional data to be included in the signed payload; each element is assumed to be one line
OtherContent []string
}
func (Checkpoint) MarshalText ¶ added in v0.2.0
func (c Checkpoint) MarshalText() ([]byte, error)
MarshalText returns the common format representation of this Checkpoint.
func (Checkpoint) Sign ¶ added in v0.2.0
func (c Checkpoint) Sign(identity string, signer crypto.Signer, opts crypto.SignerOpts) (*note.Signature, error)
func (Checkpoint) String ¶ added in v0.2.0
func (c Checkpoint) String() string
String returns the String representation of the Checkpoint
func (*Checkpoint) UnmarshalText ¶ added in v0.2.0
func (c *Checkpoint) UnmarshalText(data []byte) error
UnmarshalText parses the common formatted checkpoint data and stores the result in the Checkpoint.
The supplied data is expected to begin with the following 3 lines of text, each followed by a newline: <ecosystem/version string> <decimal representation of log size> <base64 representation of root hash> <optional non-empty line of other content>... <optional non-empty line of other content>...
This will discard any content found after the checkpoint (including signatures)
type EssCertIDv2 ¶ added in v0.2.0
type EssCertIDv2 struct {
HashAlgorithm pkix.AlgorithmIdentifier `asn1:"optional"` // SHA256
CertHash []byte
IssuerNameAndSerial IssuerNameAndSerial `asn1:"optional"`
}
type GeneralName ¶ added in v0.2.0
type IssuerNameAndSerial ¶ added in v0.2.0
type IssuerNameAndSerial struct {
IssuerName GeneralName
SerialNumber *big.Int
}
type RekorSTH ¶ added in v0.2.0
type RekorSTH struct {
SignedCheckpoint
}
func (*RekorSTH) GetTimestamp ¶ added in v0.2.0
func (*RekorSTH) SetTimestamp ¶ added in v0.2.0
type SignedCheckpoint ¶ added in v0.2.0
type SignedCheckpoint struct {
Checkpoint
// Signatures are one or more signature lines covering the payload
Signatures []note.Signature
}
func (SignedCheckpoint) MarshalText ¶ added in v0.2.0
func (s SignedCheckpoint) MarshalText() ([]byte, error)
MarshalText returns the common format representation of this SignedCheckpoint.
func (*SignedCheckpoint) Sign ¶ added in v0.2.0
func (s *SignedCheckpoint) Sign(identity string, signer crypto.Signer, opts crypto.SignerOpts) (*note.Signature, error)
Sign adds an additional signature to a SignedCheckpoint object The signature is added to the signature array as well as being directly returned to the caller
func (SignedCheckpoint) String ¶ added in v0.2.0
func (s SignedCheckpoint) String() string
String returns the String representation of the SignedCheckpoint
func (*SignedCheckpoint) UnmarshalText ¶ added in v0.2.0
func (s *SignedCheckpoint) UnmarshalText(data []byte) error
UnmarshalText parses the common formatted checkpoint data and stores the result in the SignedCheckpoint. THIS DOES NOT VERIFY SIGNATURES INSIDE THE CONTENT!
The supplied data is expected to contain a single Checkpoint, followed by a single line with no comment, followed by one or more lines with the following format:
\u2014 name signature
- name is the string associated with the signer
- signature is a base64 encoded string; the first 4 bytes of the decoded value is a hint to the public key; it is a big-endian encoded uint32 representing the first 4 bytes of the SHA256 hash of the public key
type SigningCertificateV2 ¶ added in v0.2.0
type SigningCertificateV2 struct {
Certs []EssCertIDv2
}
type TimestampRequestOptions ¶ added in v0.2.0
type TimestampRequestOptions struct {
// The policy that the client expects the TSA to use for creating the timestamp token.
// If no policy is specified the TSA uses its default policy.
TSAPolicyOid asn1.ObjectIdentifier
// The nonce to specify in the request.
Nonce *big.Int
// Hash function to use when constructing the timestamp request. Defaults to SHA-256.
Hash crypto.Hash
}