Documentation ¶
Overview ¶
Package pdclcrypto provides storage signing wrappers and tools for parsing cryptographic keys.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // VerificationErr indicates that there was an error during message verification. // It is deliberately vague to avoid adaptive attacks. VerificationErr = errors.New("message not verified successfully") SignerNotInRegistry = errors.New("signer not found in registry") )
Functions ¶
func LoadFromPKCSFromPEMFile ¶
func LoadFromPKCSFromPEMFile(privKeyPath string) (crypto.PrivateKey, error)
func ParsePKCSKeyFromPEM ¶
func ParsePKCSKeyFromPEM(pemContent []byte) (crypto.PrivateKey, error)
Types ¶
type MemorySignerRegistry ¶
type SignedMessageUnwrapper ¶
type SignedMessageUnwrapper struct {
// contains filtered or unexported fields
}
SignedMessageUnwrapper is a decorator on top of MessageReader that unwraps message from signed envelope. It does not verify signature.
func NewSignedMessageUnwrapper ¶
func NewSignedMessageUnwrapper(base storage.MessageReader, decoder storage.Decoder) *SignedMessageUnwrapper
func (*SignedMessageUnwrapper) Read ¶
func (s *SignedMessageUnwrapper) Read(ctx context.Context, cid cid.Cid) (storage.ProtoDecodable, error)
type SignedMessageVerifyReader ¶
type SignedMessageVerifyReader struct {
// contains filtered or unexported fields
}
func NewSignedMessageVerifyReader ¶
func NewSignedMessageVerifyReader(base storage.MessageReader, decoder storage.Decoder, registry SignerRegistry) *SignedMessageVerifyReader
func (*SignedMessageVerifyReader) Read ¶
func (s *SignedMessageVerifyReader) Read(ctx context.Context, cid cid.Cid) (storage.ProtoDecodable, error)
type SignedMessageWriter ¶
type SignedMessageWriter struct {
// contains filtered or unexported fields
}
SignedMessageWriter is a decorator on top of MessageWriter that puts every message into a signed envelope.
func NewSignedMessageWriter ¶
func NewSignedMessageWriter(base storage.MessageWriter, codec storage.Codec, signerID string, signer crypto.Signer) *SignedMessageWriter
type SignerRegistry ¶
Click to show internal directories.
Click to hide internal directories.