pb

package
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 6, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_pb_h132_proto protoreflect.FileDescriptor

Functions

func KeyImplSummary

func KeyImplSummary(k *KeyImpl) string

func KeyImplToString

func KeyImplToString(it isKeyImpl_Impl) string

func KeyImplTypeToString

func KeyImplTypeToString(it isKeyImpl_Impl) string

func ProtoToPriv

func ProtoToPriv(proto *P256PrivateKey) ecdsa.PrivateKey

func ProtoToPub

func ProtoToPub(proto *P256PublicKey) *ecdsa.PublicKey

func PubKeyPinString

func PubKeyPinString(pub *ecdsa.PublicKey) string

Types

type EmergencyBackupKey

type EmergencyBackupKey struct {

	// Hint about the physical location of the key mneumonic written down.
	Hint string `protobuf:"bytes,1,opt,name=hint,proto3" json:"hint,omitempty"`
	// contains filtered or unexported fields
}

The emergency backup key, used to recover envelopes in case of a TPM failure. The private key is encoded as a bip39 mneumonic, written down on a piece of paper, and stored in a safe.

func (*EmergencyBackupKey) Descriptor deprecated

func (*EmergencyBackupKey) Descriptor() ([]byte, []int)

Deprecated: Use EmergencyBackupKey.ProtoReflect.Descriptor instead.

func (*EmergencyBackupKey) GetHint

func (x *EmergencyBackupKey) GetHint() string

func (*EmergencyBackupKey) ProtoMessage

func (*EmergencyBackupKey) ProtoMessage()

func (*EmergencyBackupKey) ProtoReflect

func (x *EmergencyBackupKey) ProtoReflect() protoreflect.Message

func (*EmergencyBackupKey) Reset

func (x *EmergencyBackupKey) Reset()

func (*EmergencyBackupKey) String

func (x *EmergencyBackupKey) String() string

type EncryptedSymmetricKey

type EncryptedSymmetricKey struct {

	// The public key of the recipient used to encrypt the symmetric key
	RecipientPublicKey *P256PublicKey `protobuf:"bytes,1,opt,name=recipient_public_key,json=recipientPublicKey,proto3" json:"recipient_public_key,omitempty"`
	// The ephemeral public key of the sender used to encrypt the symmmetric key
	SenderEphemeralPublicKey *P256PublicKey `` /* 137-byte string literal not displayed */
	// The signature of the ephemeral public key by the sender key
	SenderEphemeralPublicKeySign []byte `` /* 151-byte string literal not displayed */
	// The symmetric key encrypted with the recipient's public key
	EncryptedSymmetricKey []byte `` /* 126-byte string literal not displayed */
	// The nonce used to encrypt the symmetric key
	Nonce []byte `protobuf:"bytes,5,opt,name=nonce,proto3" json:"nonce,omitempty"`
	// contains filtered or unexported fields
}

func (*EncryptedSymmetricKey) Descriptor deprecated

func (*EncryptedSymmetricKey) Descriptor() ([]byte, []int)

Deprecated: Use EncryptedSymmetricKey.ProtoReflect.Descriptor instead.

func (*EncryptedSymmetricKey) GetEncryptedSymmetricKey

func (x *EncryptedSymmetricKey) GetEncryptedSymmetricKey() []byte

func (*EncryptedSymmetricKey) GetNonce

func (x *EncryptedSymmetricKey) GetNonce() []byte

func (*EncryptedSymmetricKey) GetRecipientPublicKey

func (x *EncryptedSymmetricKey) GetRecipientPublicKey() *P256PublicKey

func (*EncryptedSymmetricKey) GetSenderEphemeralPublicKey

func (x *EncryptedSymmetricKey) GetSenderEphemeralPublicKey() *P256PublicKey

func (*EncryptedSymmetricKey) GetSenderEphemeralPublicKeySign

func (x *EncryptedSymmetricKey) GetSenderEphemeralPublicKeySign() []byte

func (*EncryptedSymmetricKey) ProtoMessage

func (*EncryptedSymmetricKey) ProtoMessage()

func (*EncryptedSymmetricKey) ProtoReflect

func (x *EncryptedSymmetricKey) ProtoReflect() protoreflect.Message

func (*EncryptedSymmetricKey) Reset

func (x *EncryptedSymmetricKey) Reset()

func (*EncryptedSymmetricKey) String

func (x *EncryptedSymmetricKey) String() string

type Envelope

type Envelope struct {
	LetterProto []byte `protobuf:"bytes,1,opt,name=letter_proto,json=letterProto,proto3" json:"letter_proto,omitempty"`
	Signature   []byte `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"`
	// contains filtered or unexported fields
}

func (*Envelope) Descriptor deprecated

func (*Envelope) Descriptor() ([]byte, []int)

Deprecated: Use Envelope.ProtoReflect.Descriptor instead.

func (*Envelope) GetLetterProto

func (x *Envelope) GetLetterProto() []byte

func (*Envelope) GetSignature

func (x *Envelope) GetSignature() []byte

func (*Envelope) ProtoMessage

func (*Envelope) ProtoMessage()

func (*Envelope) ProtoReflect

func (x *Envelope) ProtoReflect() protoreflect.Message

func (*Envelope) Reset

func (x *Envelope) Reset()

func (*Envelope) String

func (x *Envelope) String() string

type KeyImpl

type KeyImpl struct {

	// The name of the key, specified by the user when starting a h132 session.
	Name      string         `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	PublicKey *P256PublicKey `protobuf:"bytes,2,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"`
	// Types that are assignable to Impl:
	//
	//	*KeyImpl_DebugRawKey
	//	*KeyImpl_EmergencyBackupKey
	//	*KeyImpl_WebauthnWrappedTpm
	Impl isKeyImpl_Impl `protobuf_oneof:"impl"`
	// contains filtered or unexported fields
}

func KeyToProto

func KeyToProto(name string, k KeyT) (*KeyImpl, error)

func (*KeyImpl) Descriptor deprecated

func (*KeyImpl) Descriptor() ([]byte, []int)

Deprecated: Use KeyImpl.ProtoReflect.Descriptor instead.

func (*KeyImpl) GetDebugRawKey

func (x *KeyImpl) GetDebugRawKey() *P256PrivateKey

func (*KeyImpl) GetEmergencyBackupKey

func (x *KeyImpl) GetEmergencyBackupKey() *EmergencyBackupKey

func (*KeyImpl) GetImpl

func (m *KeyImpl) GetImpl() isKeyImpl_Impl

func (*KeyImpl) GetName

func (x *KeyImpl) GetName() string

func (*KeyImpl) GetPublicKey

func (x *KeyImpl) GetPublicKey() *P256PublicKey

func (*KeyImpl) GetWebauthnWrappedTpm

func (x *KeyImpl) GetWebauthnWrappedTpm() *WebAuthnWrappedTPMKey

func (*KeyImpl) ProtoMessage

func (*KeyImpl) ProtoMessage()

func (*KeyImpl) ProtoReflect

func (x *KeyImpl) ProtoReflect() protoreflect.Message

func (*KeyImpl) Reset

func (x *KeyImpl) Reset()

func (*KeyImpl) String

func (x *KeyImpl) String() string

type KeyImpl_DebugRawKey

type KeyImpl_DebugRawKey struct {
	// Private key presented in the clear. Only used for debugging.
	// h132 refuses to operate unless the debug flag is set.
	DebugRawKey *P256PrivateKey `protobuf:"bytes,10,opt,name=debug_raw_key,json=debugRawKey,proto3,oneof"`
}

type KeyImpl_EmergencyBackupKey

type KeyImpl_EmergencyBackupKey struct {
	EmergencyBackupKey *EmergencyBackupKey `protobuf:"bytes,11,opt,name=emergency_backup_key,json=emergencyBackupKey,proto3,oneof"`
}

type KeyImpl_WebauthnWrappedTpm

type KeyImpl_WebauthnWrappedTpm struct {
	WebauthnWrappedTpm *WebAuthnWrappedTPMKey `protobuf:"bytes,12,opt,name=webauthn_wrapped_tpm,json=webauthnWrappedTpm,proto3,oneof"`
}

type KeyT

type KeyT interface {
	Pub() (*ecdsa.PublicKey, error)
	SetImplProto(p *KeyImpl) error
}

type Letter

type Letter struct {
	Ciphertext      []byte                   `protobuf:"bytes,1,opt,name=ciphertext,proto3" json:"ciphertext,omitempty"`
	Nonce           []byte                   `protobuf:"bytes,2,opt,name=nonce,proto3" json:"nonce,omitempty"`
	RecipientKeys   []*EncryptedSymmetricKey `protobuf:"bytes,3,rep,name=recipient_keys,json=recipientKeys,proto3" json:"recipient_keys,omitempty"`
	SenderPublicKey *P256PublicKey           `protobuf:"bytes,4,opt,name=sender_public_key,json=senderPublicKey,proto3" json:"sender_public_key,omitempty"`
	// contains filtered or unexported fields
}

func (*Letter) Descriptor deprecated

func (*Letter) Descriptor() ([]byte, []int)

Deprecated: Use Letter.ProtoReflect.Descriptor instead.

func (*Letter) GetCiphertext

func (x *Letter) GetCiphertext() []byte

func (*Letter) GetNonce

func (x *Letter) GetNonce() []byte

func (*Letter) GetRecipientKeys

func (x *Letter) GetRecipientKeys() []*EncryptedSymmetricKey

func (*Letter) GetSenderPublicKey

func (x *Letter) GetSenderPublicKey() *P256PublicKey

func (*Letter) ProtoMessage

func (*Letter) ProtoMessage()

func (*Letter) ProtoReflect

func (x *Letter) ProtoReflect() protoreflect.Message

func (*Letter) Reset

func (x *Letter) Reset()

func (*Letter) String

func (x *Letter) String() string

type LetterWritingSet

type LetterWritingSet struct {

	// The name of the letter writing set - presented to the user when operating
	// under the letter writing set.
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// The keys that can decrypt the envelopes.
	Keys []*KeyImpl `protobuf:"bytes,2,rep,name=keys,proto3" json:"keys,omitempty"`
	// Shell command before editing a envelope. The envelope path is passed as an argument.
	PreEditHook string `protobuf:"bytes,10,opt,name=pre_edit_hook,json=preEditHook,proto3" json:"pre_edit_hook,omitempty"`
	// Shell command after new envelope is created or edited. The envelope path is passed as an argument.
	PostEditHook string `protobuf:"bytes,11,opt,name=post_edit_hook,json=postEditHook,proto3" json:"post_edit_hook,omitempty"`
	// contains filtered or unexported fields
}

LetterWritingSet is a h132 configuration that is stored as "h132_letter_writing_set.binpb" file in the directory with the envelopes.

func (*LetterWritingSet) Descriptor deprecated

func (*LetterWritingSet) Descriptor() ([]byte, []int)

Deprecated: Use LetterWritingSet.ProtoReflect.Descriptor instead.

func (*LetterWritingSet) GetKeys

func (x *LetterWritingSet) GetKeys() []*KeyImpl

func (*LetterWritingSet) GetName

func (x *LetterWritingSet) GetName() string

func (*LetterWritingSet) GetPostEditHook

func (x *LetterWritingSet) GetPostEditHook() string

func (*LetterWritingSet) GetPreEditHook

func (x *LetterWritingSet) GetPreEditHook() string

func (*LetterWritingSet) ProtoMessage

func (*LetterWritingSet) ProtoMessage()

func (*LetterWritingSet) ProtoReflect

func (x *LetterWritingSet) ProtoReflect() protoreflect.Message

func (*LetterWritingSet) Reset

func (x *LetterWritingSet) Reset()

func (*LetterWritingSet) String

func (x *LetterWritingSet) String() string

type P256PrivateKey

type P256PrivateKey struct {
	D []byte `protobuf:"bytes,1,opt,name=d,proto3" json:"d,omitempty"`
	// contains filtered or unexported fields
}

func PrivToProto

func PrivToProto(priv ecdsa.PrivateKey) *P256PrivateKey

func (*P256PrivateKey) Descriptor deprecated

func (*P256PrivateKey) Descriptor() ([]byte, []int)

Deprecated: Use P256PrivateKey.ProtoReflect.Descriptor instead.

func (*P256PrivateKey) GetD

func (x *P256PrivateKey) GetD() []byte

func (*P256PrivateKey) ProtoMessage

func (*P256PrivateKey) ProtoMessage()

func (*P256PrivateKey) ProtoReflect

func (x *P256PrivateKey) ProtoReflect() protoreflect.Message

func (*P256PrivateKey) Reset

func (x *P256PrivateKey) Reset()

func (*P256PrivateKey) String

func (x *P256PrivateKey) String() string

type P256PublicKey

type P256PublicKey struct {
	X []byte `protobuf:"bytes,1,opt,name=x,proto3" json:"x,omitempty"`
	Y []byte `protobuf:"bytes,2,opt,name=y,proto3" json:"y,omitempty"`
	// contains filtered or unexported fields
}

func PubToProto

func PubToProto(pub *ecdsa.PublicKey) *P256PublicKey

func (*P256PublicKey) Descriptor deprecated

func (*P256PublicKey) Descriptor() ([]byte, []int)

Deprecated: Use P256PublicKey.ProtoReflect.Descriptor instead.

func (*P256PublicKey) GetX

func (x *P256PublicKey) GetX() []byte

func (*P256PublicKey) GetY

func (x *P256PublicKey) GetY() []byte

func (*P256PublicKey) ProtoMessage

func (*P256PublicKey) ProtoMessage()

func (*P256PublicKey) ProtoReflect

func (x *P256PublicKey) ProtoReflect() protoreflect.Message

func (*P256PublicKey) Reset

func (x *P256PublicKey) Reset()

func (*P256PublicKey) String

func (x *P256PublicKey) String() string

type WebAuthnWrappedTPMKey

type WebAuthnWrappedTPMKey struct {

	// The URL used to trigger WebAuthn interaction.
	ReflectorUrl string `protobuf:"bytes,1,opt,name=reflector_url,json=reflectorUrl,proto3" json:"reflector_url,omitempty"`
	// The key handle used to identify the key in the TPM.
	TpmKeyHandle uint32 `protobuf:"varint,2,opt,name=tpm_key_handle,json=tpmKeyHandle,proto3" json:"tpm_key_handle,omitempty"`
	// The salt given to retrieve PRF output from WebAuthn. Must be 32 bytes.
	PrfSalt []byte `protobuf:"bytes,3,opt,name=prf_salt,json=prfSalt,proto3" json:"prf_salt,omitempty"`
	// The salt given to HKDF to derive the TPM passphrase from the PRF output.
	HkdfSalt []byte `protobuf:"bytes,4,opt,name=hkdf_salt,json=hkdfSalt,proto3" json:"hkdf_salt,omitempty"`
	// The username used to derive the WebAuthn credential {id, name, displayName}.
	WebauthnUsername string `protobuf:"bytes,5,opt,name=webauthn_username,json=webauthnUsername,proto3" json:"webauthn_username,omitempty"`
	// The credential JSON returned by WebAuthn.
	WebauthnCredentialJson []byte `` /* 129-byte string literal not displayed */
	// contains filtered or unexported fields
}

A TPM key, with a passphrase derived from WebAuthn PRF.

func (*WebAuthnWrappedTPMKey) Descriptor deprecated

func (*WebAuthnWrappedTPMKey) Descriptor() ([]byte, []int)

Deprecated: Use WebAuthnWrappedTPMKey.ProtoReflect.Descriptor instead.

func (*WebAuthnWrappedTPMKey) GetHkdfSalt

func (x *WebAuthnWrappedTPMKey) GetHkdfSalt() []byte

func (*WebAuthnWrappedTPMKey) GetPrfSalt

func (x *WebAuthnWrappedTPMKey) GetPrfSalt() []byte

func (*WebAuthnWrappedTPMKey) GetReflectorUrl

func (x *WebAuthnWrappedTPMKey) GetReflectorUrl() string

func (*WebAuthnWrappedTPMKey) GetTpmKeyHandle

func (x *WebAuthnWrappedTPMKey) GetTpmKeyHandle() uint32

func (*WebAuthnWrappedTPMKey) GetWebauthnCredentialJson

func (x *WebAuthnWrappedTPMKey) GetWebauthnCredentialJson() []byte

func (*WebAuthnWrappedTPMKey) GetWebauthnUsername

func (x *WebAuthnWrappedTPMKey) GetWebauthnUsername() string

func (*WebAuthnWrappedTPMKey) ProtoMessage

func (*WebAuthnWrappedTPMKey) ProtoMessage()

func (*WebAuthnWrappedTPMKey) ProtoReflect

func (x *WebAuthnWrappedTPMKey) ProtoReflect() protoreflect.Message

func (*WebAuthnWrappedTPMKey) Reset

func (x *WebAuthnWrappedTPMKey) Reset()

func (*WebAuthnWrappedTPMKey) String

func (x *WebAuthnWrappedTPMKey) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL