Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var OID_EC asn1.ObjectIdentifier = []int{1, 2, 840, 10045, 2, 1}
View Source
var OID_RSA_PSS asn1.ObjectIdentifier = []int{1, 2, 840, 113549, 1, 1, 10}
View Source
var OID_SECP256K1 asn1.ObjectIdentifier = []int{1, 3, 132, 0, 10}
Functions ¶
Types ¶
type Builder ¶
type Builder interface { Sign(input io.ReadSeeker, output io.ReadWriteSeeker, mimeType string) error SignFile(infile, outfile string) error }
func NewBuilder ¶
func NewBuilder(manifest *ManifestDefinition, params *BuilderParams) (Builder, error)
type BuilderParams ¶
type BuilderParams struct { Cert []byte Signer crypto.Signer TAURL string Algorithm *SigningAlgorithm }
type C2PABuilder ¶
type C2PABuilder struct {
// contains filtered or unexported fields
}
func (*C2PABuilder) Sign ¶
func (b *C2PABuilder) Sign(input io.ReadSeeker, output io.ReadWriteSeeker, mimeType string) error
func (*C2PABuilder) SignFile ¶
func (b *C2PABuilder) SignFile(infile, outfile string) error
helper function for operating on files
type C2PACallbackSigner ¶
type C2PACallbackSigner struct {
// contains filtered or unexported fields
}
type C2PAReader ¶
type C2PAReader struct {
// contains filtered or unexported fields
}
func (*C2PAReader) GetActiveManifest ¶
func (r *C2PAReader) GetActiveManifest() *manifeststore.Manifest
func (*C2PAReader) GetManifest ¶
func (r *C2PAReader) GetManifest(label string) *manifeststore.Manifest
func (*C2PAReader) GetProvenanceCertChain ¶
func (r *C2PAReader) GetProvenanceCertChain() string
type C2PAStreamReader ¶
type C2PAStreamReader struct {
io.ReadSeeker
}
Wrapped io.ReadSeeker for passing to Rust. Doesn't write.
func (*C2PAStreamReader) ReadStream ¶
func (s *C2PAStreamReader) ReadStream(length uint64) ([]byte, *rustC2PA.Error)
func (*C2PAStreamReader) SeekStream ¶
type C2PAStreamWriter ¶
type C2PAStreamWriter struct {
io.ReadWriteSeeker
}
Wrapped io.Writer for passing to Rust.
func (*C2PAStreamWriter) ReadStream ¶
func (s *C2PAStreamWriter) ReadStream(length uint64) ([]byte, *rustC2PA.Error)
func (*C2PAStreamWriter) SeekStream ¶
type ManifestDefinition ¶
type ManifestDefinition manifestdefinition.ManifestDefinitionSchemaJson
type Reader ¶
type Reader interface { GetManifest(label string) *manifeststore.Manifest GetActiveManifest() *manifeststore.Manifest GetProvenanceCertChain() string }
type SigningAlgorithm ¶
type SigningAlgorithm struct { Name SigningAlgorithmName RustC2PAType rustC2PA.SigningAlg Hash crypto.Hash }
func GetSigningAlgorithm ¶
func GetSigningAlgorithm(algStr string) (*SigningAlgorithm, error)
func (*SigningAlgorithm) Digest ¶
func (alg *SigningAlgorithm) Digest(data []byte) ([]byte, crypto.SignerOpts, error)
get digest and crypto options for passing to the actual signer
type SigningAlgorithmName ¶
type SigningAlgorithmName string
const ( ED25519 SigningAlgorithmName = "ed25519" ES256 SigningAlgorithmName = "es256" ES256K SigningAlgorithmName = "es256k" ES384 SigningAlgorithmName = "es384" ES512 SigningAlgorithmName = "es512" PS256 SigningAlgorithmName = "ps256" PS384 SigningAlgorithmName = "ps384" PS512 SigningAlgorithmName = "ps512" )
Click to show internal directories.
Click to hide internal directories.