Documentation ¶
Index ¶
- Constants
- func BorrowedMutableBuffer(length int) C.SignalBorrowedMutableBuffer
- func BytesToBuffer(data []byte) C.SignalBorrowedBuffer
- func CopyBufferToBytes(buffer *C.uchar, length C.size_t) (b []byte)
- func CopyCStringToString(cString *C.char) (s string)
- func CopySignalOwnedBufferToBytes(buffer C.SignalOwnedBuffer) (b []byte)
- func Decrypt(ctx context.Context, message *Message, fromAddress *Address, ...) ([]byte, error)
- func DecryptPreKey(ctx context.Context, preKeyMessage *PreKeyMessage, fromAddress *Address, ...) ([]byte, error)
- func EmptyBorrowedBuffer() C.SignalBorrowedBuffer
- func GroupDecrypt(ctx context.Context, ctext []byte, sender *Address, store SenderKeyStore) ([]byte, error)
- func HKDFDerive(outputLength int, inputKeyMaterial, salt, info []byte) ([]byte, error)
- func InitLogger(level LogLevel, logger Logger)
- func ProcessPreKeyBundle(ctx context.Context, bundle *PreKeyBundle, forAddress *Address, ...) error
- func ProcessSenderKeyDistributionMessage(ctx context.Context, message *SenderKeyDistributionMessage, ...) error
- func SealedSenderEncrypt(ctx context.Context, usmc *UnidentifiedSenderMessageContent, ...) ([]byte, error)
- func SealedSenderEncryptPlaintext(ctx context.Context, message []byte, forAddress *Address, ...) ([]byte, error)
- func SealedSenderMultiRecipientEncrypt(messageContent *UnidentifiedSenderMessageContent, forRecipients []*Address, ...) ([]byte, error)
- func ServerPublicParamsVerifySignature(serverPublicParams ServerPublicParams, messageBytes []byte, ...) error
- type AES256_GCM_SIV
- type AccessKey
- type Address
- type AuthCredentialPresentation
- type AuthCredentialWithPni
- type AuthCredentialWithPniResponse
- type CallbackContext
- type CiphertextMessage
- func Encrypt(ctx context.Context, plaintext []byte, forAddress *Address, ...) (*CiphertextMessage, error)
- func GroupEncrypt(ctx context.Context, ptext []byte, sender *Address, distributionID uuid.UUID, ...) (*CiphertextMessage, error)
- func NewCiphertextMessage(plaintext *PlaintextContent) (*CiphertextMessage, error)
- type CiphertextMessageType
- type DecryptionErrorMessage
- func DecryptionErrorMessageForOriginalMessage(originalBytes []byte, originalType uint8, originalTs uint64, ...) (*DecryptionErrorMessage, error)
- func DecryptionErrorMessageFromSerializedContent(serialized []byte) (*DecryptionErrorMessage, error)
- func DeserializeDecryptionErrorMessage(messageBytes []byte) (*DecryptionErrorMessage, error)
- func (dem *DecryptionErrorMessage) CancelFinalizer()
- func (dem *DecryptionErrorMessage) Clone() (*DecryptionErrorMessage, error)
- func (dem *DecryptionErrorMessage) Destroy() error
- func (dem *DecryptionErrorMessage) GetDeviceID() (uint32, error)
- func (dem *DecryptionErrorMessage) GetRatchetKey() (*PublicKey, error)
- func (dem *DecryptionErrorMessage) GetTimestamp() (time.Time, error)
- func (dem *DecryptionErrorMessage) Serialize() ([]byte, error)
- type DeviceTransferKey
- type ErrorCode
- type ExpiringProfileKeyCredential
- type ExpiringProfileKeyCredentialResponse
- type Fingerprint
- type FingerprintVersion
- type GroupIdentifier
- type GroupMasterKey
- type GroupPublicParams
- type GroupSecretParams
- func (gsp *GroupSecretParams) CreateExpiringProfileKeyCredentialPresentation(spp ServerPublicParams, credential ExpiringProfileKeyCredential) (*ProfileKeyCredentialPresentation, error)
- func (gsp *GroupSecretParams) DecryptBlobWithPadding(blob []byte) ([]byte, error)
- func (gsp *GroupSecretParams) DecryptProfileKey(ciphertextProfileKey ProfileKeyCiphertext, u uuid.UUID) (*ProfileKey, error)
- func (gsp *GroupSecretParams) DecryptServiceID(ciphertextServiceID UUIDCiphertext) (ServiceID, error)
- func (gsp *GroupSecretParams) EncryptBlobWithPaddingDeterministic(randomness Randomness, plaintext []byte, padding_len uint32) ([]byte, error)
- func (gsp *GroupSecretParams) EncryptProfileKey(profileKey ProfileKey, u uuid.UUID) (*ProfileKeyCiphertext, error)
- func (gsp *GroupSecretParams) EncryptServiceID(serviceID ServiceID) (*UUIDCiphertext, error)
- func (gsp *GroupSecretParams) GetMasterKey() (*GroupMasterKey, error)
- func (gsp *GroupSecretParams) GetPublicParams() (*GroupPublicParams, error)
- type HSMEnclaveClient
- func (hsm *HSMEnclaveClient) CompleteHandshake(handshakeReceived []byte) error
- func (hsm *HSMEnclaveClient) Destroy() error
- func (hsm *HSMEnclaveClient) EstablishedReceive(ciphertext []byte) ([]byte, error)
- func (hsm *HSMEnclaveClient) EstablishedSend(plaintext []byte) ([]byte, error)
- func (hsm *HSMEnclaveClient) InitialRequest() ([]byte, error)
- type IdentityKey
- type IdentityKeyPair
- type IdentityKeyStore
- type KyberKeyPair
- type KyberPreKeyRecord
- func (kpkr *KyberPreKeyRecord) CancelFinalizer()
- func (kpkr *KyberPreKeyRecord) Clone() (*KyberPreKeyRecord, error)
- func (kpkr *KyberPreKeyRecord) Destroy() error
- func (kpkr *KyberPreKeyRecord) GetID() (uint32, error)
- func (kpkr *KyberPreKeyRecord) GetPublicKey() (*KyberPublicKey, error)
- func (kpkr *KyberPreKeyRecord) GetSecretKey() (*KyberSecretKey, error)
- func (kpkr *KyberPreKeyRecord) GetSignature() ([]byte, error)
- func (kpkr *KyberPreKeyRecord) GetTimestamp() (time.Time, error)
- func (kpkr *KyberPreKeyRecord) Serialize() ([]byte, error)
- type KyberPreKeyStore
- type KyberPublicKey
- type KyberSecretKey
- type LogLevel
- type Logger
- type Message
- func (m *Message) CancelFinalizer()
- func (m *Message) Clone() (*Message, error)
- func (m *Message) Destroy() error
- func (m *Message) GetBody() ([]byte, error)
- func (m *Message) GetCounter() (uint32, error)
- func (m *Message) GetMessageVersion() (uint32, error)
- func (m *Message) Serialize() ([]byte, error)
- func (m *Message) VerifyMAC(sender, receiver *PublicKey, macKey []byte) (bool, error)
- type NotarySignature
- type PlaintextContent
- type PreKeyBundle
- type PreKeyMessage
- func (m *PreKeyMessage) CancelFinalizer()
- func (m *PreKeyMessage) Clone() (*PreKeyMessage, error)
- func (m *PreKeyMessage) Destroy() error
- func (m *PreKeyMessage) GetBaseKey() (*PublicKey, error)
- func (m *PreKeyMessage) GetIdentityKey() (*IdentityKey, error)
- func (m *PreKeyMessage) GetPreKeyID() (*uint32, error)
- func (m *PreKeyMessage) GetRegistrationID() (uint32, error)
- func (m *PreKeyMessage) GetSignalMessage() (*Message, error)
- func (m *PreKeyMessage) GetSignedPreKeyID() (uint32, error)
- func (m *PreKeyMessage) GetVersion() (uint32, error)
- func (m *PreKeyMessage) Serialize() ([]byte, error)
- type PreKeyRecord
- func (pkr *PreKeyRecord) CancelFinalizer()
- func (pkr *PreKeyRecord) Clone() (*PreKeyRecord, error)
- func (pkr *PreKeyRecord) Destroy() error
- func (pkr *PreKeyRecord) GetID() (uint32, error)
- func (pkr *PreKeyRecord) GetPrivateKey() (*PrivateKey, error)
- func (pkr *PreKeyRecord) GetPublicKey() (*PublicKey, error)
- func (pkr *PreKeyRecord) Serialize() ([]byte, error)
- type PreKeyStore
- type PrivateKey
- func (pk *PrivateKey) Agree(publicKey *PublicKey) ([]byte, error)
- func (pk *PrivateKey) CancelFinalizer()
- func (pk *PrivateKey) Clone() (*PrivateKey, error)
- func (pk *PrivateKey) Destroy() error
- func (pk *PrivateKey) GetPublicKey() (*PublicKey, error)
- func (pk *PrivateKey) Serialize() ([]byte, error)
- func (pk *PrivateKey) Sign(message []byte) ([]byte, error)
- type ProfileKey
- type ProfileKeyCiphertext
- type ProfileKeyCommitment
- type ProfileKeyCredentialPresentation
- type ProfileKeyCredentialRequest
- type ProfileKeyCredentialRequestContext
- type ProfileKeyCredentialResponse
- type ProfileKeyVersion
- type PublicKey
- func (k *PublicKey) Bytes() ([]byte, error)
- func (k *PublicKey) CancelFinalizer()
- func (pk *PublicKey) Clone() (*PublicKey, error)
- func (k *PublicKey) Compare(other *PublicKey) (int, error)
- func (k *PublicKey) Destroy() error
- func (pk *PublicKey) Serialize() ([]byte, error)
- func (k *PublicKey) Verify(message, signature []byte) (bool, error)
- type Randomness
- type SGXClientState
- func (cds *SGXClientState) CompleteHandshake(handshakeReceived []byte) error
- func (cds *SGXClientState) Destroy() error
- func (cds *SGXClientState) EstablishedReceive(ciphertext []byte) ([]byte, error)
- func (cds *SGXClientState) EstablishedSend(plaintext []byte) ([]byte, error)
- func (cds *SGXClientState) InitialRequest() ([]byte, error)
- type SealedSenderAddress
- type SealedSenderResult
- type SenderCertificate
- func (sc *SenderCertificate) CancelFinalizer()
- func (sc *SenderCertificate) Clone() (*SenderCertificate, error)
- func (sc *SenderCertificate) Destroy() error
- func (sc *SenderCertificate) GetCertificate() ([]byte, error)
- func (sc *SenderCertificate) GetDeviceID() (uint32, error)
- func (sc *SenderCertificate) GetExpiration() (time.Time, error)
- func (sc *SenderCertificate) GetKey() (*PublicKey, error)
- func (sc *SenderCertificate) GetSenderE164() (string, error)
- func (sc *SenderCertificate) GetSenderUUID() (uuid.UUID, error)
- func (sc *SenderCertificate) GetServerCertificate() (*ServerCertificate, error)
- func (sc *SenderCertificate) GetSignature() ([]byte, error)
- func (sc *SenderCertificate) Serialize() ([]byte, error)
- func (sc *SenderCertificate) Validate(trustRoot *PublicKey, ts time.Time) (bool, error)
- type SenderKeyDistributionMessage
- type SenderKeyRecord
- type SenderKeyStore
- type ServerCertificate
- func (sc *ServerCertificate) CancelFinalizer()
- func (sc *ServerCertificate) Clone() (*ServerCertificate, error)
- func (sc *ServerCertificate) Destroy() error
- func (sc *ServerCertificate) GetCertificate() ([]byte, error)
- func (sc *ServerCertificate) GetKey() (*PublicKey, error)
- func (sc *ServerCertificate) GetKeyID() (uint32, error)
- func (sc *ServerCertificate) GetSignature() ([]byte, error)
- func (sc *ServerCertificate) Serialize() ([]byte, error)
- type ServerPublicParams
- type ServiceID
- func (s ServiceID) Address(deviceID uint) (*Address, error)
- func (s ServiceID) Bytes() []byte
- func (s ServiceID) CFixedBytes() cPNIType
- func (s ServiceID) FixedBytes() *ServiceIDFixedBytes
- func (s ServiceID) GoString() string
- func (s ServiceID) IsEmpty() bool
- func (s ServiceID) MarshalZerologObject(e *zerolog.Event)
- func (s ServiceID) String() string
- func (s ServiceID) Value() (driver.Value, error)
- type ServiceIDFixedBytes
- type ServiceIDType
- type SessionRecord
- func (sr *SessionRecord) ArchiveCurrentState() error
- func (sr *SessionRecord) CancelFinalizer()
- func (sr *SessionRecord) Clone() (*SessionRecord, error)
- func (sr *SessionRecord) CurrentRatchetKeyMatches(key *PublicKey) (bool, error)
- func (sr *SessionRecord) Destroy() error
- func (sr *SessionRecord) GetLocalRegistrationID() (uint32, error)
- func (sr *SessionRecord) GetRemoteRegistrationID() (uint32, error)
- func (sr *SessionRecord) HasCurrentState() (bool, error)
- func (sr *SessionRecord) Serialize() ([]byte, error)
- type SessionStore
- type SignalDirection
- type SignalError
- type SignedPreKeyRecord
- func DeserializeSignedPreKeyRecord(serialized []byte) (*SignedPreKeyRecord, error)
- func NewSignedPreKeyRecord(id uint32, timestamp time.Time, publicKey *PublicKey, privateKey *PrivateKey, ...) (*SignedPreKeyRecord, error)
- func NewSignedPreKeyRecordFromPrivateKey(id uint32, timestamp time.Time, privateKey *PrivateKey, signature []byte) (*SignedPreKeyRecord, error)
- func (spkr *SignedPreKeyRecord) CancelFinalizer()
- func (spkr *SignedPreKeyRecord) Clone() (*SignedPreKeyRecord, error)
- func (spkr *SignedPreKeyRecord) Destroy() error
- func (spkr *SignedPreKeyRecord) GetID() (uint32, error)
- func (spkr *SignedPreKeyRecord) GetPrivateKey() (*PrivateKey, error)
- func (spkr *SignedPreKeyRecord) GetPublicKey() (*PublicKey, error)
- func (spkr *SignedPreKeyRecord) GetSignature() ([]byte, error)
- func (spkr *SignedPreKeyRecord) GetTimestamp() (time.Time, error)
- func (spkr *SignedPreKeyRecord) Serialize() ([]byte, error)
- type SignedPreKeyStore
- type UUIDCiphertext
- type UnidentifiedSenderMessageContent
- func DeserializeUnidentifiedSenderMessageContent(serialized []byte) (*UnidentifiedSenderMessageContent, error)
- func NewUnidentifiedSenderMessageContent(message *CiphertextMessage, senderCertificate *SenderCertificate, ...) (*UnidentifiedSenderMessageContent, error)
- func SealedSenderDecryptToUSMC(ctx context.Context, ciphertext []byte, identityStore IdentityKeyStore) (*UnidentifiedSenderMessageContent, error)
- func (usmc *UnidentifiedSenderMessageContent) CancelFinalizer()
- func (usmc *UnidentifiedSenderMessageContent) Destroy() error
- func (usmc *UnidentifiedSenderMessageContent) GetContentHint() (UnidentifiedSenderMessageContentHint, error)
- func (usmc *UnidentifiedSenderMessageContent) GetContents() ([]byte, error)
- func (usmc *UnidentifiedSenderMessageContent) GetMessageType() (CiphertextMessageType, error)
- func (usmc *UnidentifiedSenderMessageContent) GetSenderCertificate() (*SenderCertificate, error)
- func (usmc *UnidentifiedSenderMessageContent) Serialize() ([]byte, error)
- type UnidentifiedSenderMessageContentHint
- type WrappedStore
Constants ¶
View Source
const GroupMasterKeyLength = C.SignalGROUP_MASTER_KEY_LEN
View Source
const ProfileKeyLength = C.SignalPROFILE_KEY_LEN
View Source
const Version = "v0.44.0"
Variables ¶
This section is empty.
Functions ¶
func BorrowedMutableBuffer ¶
func BorrowedMutableBuffer(length int) C.SignalBorrowedMutableBuffer
func BytesToBuffer ¶
func BytesToBuffer(data []byte) C.SignalBorrowedBuffer
func CopyCStringToString ¶
func CopySignalOwnedBufferToBytes ¶
func CopySignalOwnedBufferToBytes(buffer C.SignalOwnedBuffer) (b []byte)
func Decrypt ¶
func Decrypt(ctx context.Context, message *Message, fromAddress *Address, sessionStore SessionStore, identityStore IdentityKeyStore) ([]byte, error)
func DecryptPreKey ¶
func DecryptPreKey(ctx context.Context, preKeyMessage *PreKeyMessage, fromAddress *Address, sessionStore SessionStore, identityStore IdentityKeyStore, preKeyStore PreKeyStore, signedPreKeyStore SignedPreKeyStore, kyberPreKeyStore KyberPreKeyStore) ([]byte, error)
func EmptyBorrowedBuffer ¶
func EmptyBorrowedBuffer() C.SignalBorrowedBuffer
func GroupDecrypt ¶
func HKDFDerive ¶
func InitLogger ¶
func ProcessPreKeyBundle ¶
func ProcessPreKeyBundle(ctx context.Context, bundle *PreKeyBundle, forAddress *Address, sessionStore SessionStore, identityStore IdentityKeyStore) error
func ProcessSenderKeyDistributionMessage ¶
func ProcessSenderKeyDistributionMessage(ctx context.Context, message *SenderKeyDistributionMessage, fromSender *Address, store SenderKeyStore) error
func SealedSenderEncrypt ¶
func SealedSenderEncrypt(ctx context.Context, usmc *UnidentifiedSenderMessageContent, forRecipient *Address, identityStore IdentityKeyStore) ([]byte, error)
func SealedSenderEncryptPlaintext ¶
func SealedSenderEncryptPlaintext(ctx context.Context, message []byte, forAddress *Address, fromSenderCert *SenderCertificate, sessionStore SessionStore, identityStore IdentityKeyStore) ([]byte, error)
func SealedSenderMultiRecipientEncrypt ¶
func SealedSenderMultiRecipientEncrypt(messageContent *UnidentifiedSenderMessageContent, forRecipients []*Address, identityStore IdentityKeyStore, sessionStore SessionStore, ctx *CallbackContext) ([]byte, error)
func ServerPublicParamsVerifySignature ¶
func ServerPublicParamsVerifySignature( serverPublicParams ServerPublicParams, messageBytes []byte, NotarySignature NotarySignature, ) error
Types ¶
type AES256_GCM_SIV ¶
type AES256_GCM_SIV struct {
// contains filtered or unexported fields
}
func NewAES256_GCM_SIV ¶
func NewAES256_GCM_SIV(key []byte) (*AES256_GCM_SIV, error)
func (*AES256_GCM_SIV) Decrypt ¶
func (aes *AES256_GCM_SIV) Decrypt(ciphertext, nonce, associatedData []byte) ([]byte, error)
func (*AES256_GCM_SIV) Destroy ¶
func (aes *AES256_GCM_SIV) Destroy() error
type AccessKey ¶
type AccessKey [C.SignalACCESS_KEY_LEN]byte
type Address ¶
type Address struct {
// contains filtered or unexported fields
}
func (*Address) CancelFinalizer ¶
func (pa *Address) CancelFinalizer()
func (*Address) NameServiceID ¶ added in v0.6.0
type AuthCredentialPresentation ¶
type AuthCredentialPresentation []byte
func CreateAuthCredentialWithPniPresentation ¶
func CreateAuthCredentialWithPniPresentation( serverPublicParams ServerPublicParams, randomness Randomness, groupSecretParams GroupSecretParams, authCredWithPni AuthCredentialWithPni, ) (*AuthCredentialPresentation, error)
type AuthCredentialWithPni ¶
type AuthCredentialWithPni [C.SignalAUTH_CREDENTIAL_WITH_PNI_LEN]byte
type AuthCredential [C.SignalAUTH_CREDENTIAL_LEN]byte type AuthCredentialResponse [C.SignalAUTH_CREDENTIAL_RESPONSE_LEN]byte
func ReceiveAuthCredentialWithPni ¶
func ReceiveAuthCredentialWithPni( serverPublicParams ServerPublicParams, aci uuid.UUID, pni uuid.UUID, redemptionTime uint64, authCredResponse AuthCredentialWithPniResponse, ) (*AuthCredentialWithPni, error)
func (*AuthCredentialWithPni) Slice ¶
func (ac *AuthCredentialWithPni) Slice() []byte
type AuthCredentialWithPniResponse ¶
type AuthCredentialWithPniResponse [C.SignalAUTH_CREDENTIAL_WITH_PNI_RESPONSE_LEN]byte
func NewAuthCredentialWithPniResponse ¶
func NewAuthCredentialWithPniResponse(b []byte) (*AuthCredentialWithPniResponse, error)
type CallbackContext ¶
func NewCallbackContext ¶
func NewCallbackContext(ctx context.Context) *CallbackContext
func (*CallbackContext) Unref ¶
func (ctx *CallbackContext) Unref()
type CiphertextMessage ¶
type CiphertextMessage struct {
// contains filtered or unexported fields
}
func Encrypt ¶
func Encrypt(ctx context.Context, plaintext []byte, forAddress *Address, sessionStore SessionStore, identityKeyStore IdentityKeyStore) (*CiphertextMessage, error)
func GroupEncrypt ¶
func GroupEncrypt(ctx context.Context, ptext []byte, sender *Address, distributionID uuid.UUID, store SenderKeyStore) (*CiphertextMessage, error)
func NewCiphertextMessage ¶
func NewCiphertextMessage(plaintext *PlaintextContent) (*CiphertextMessage, error)
func (*CiphertextMessage) CancelFinalizer ¶
func (c *CiphertextMessage) CancelFinalizer()
func (*CiphertextMessage) Destroy ¶
func (c *CiphertextMessage) Destroy() error
func (*CiphertextMessage) MessageType ¶
func (c *CiphertextMessage) MessageType() (CiphertextMessageType, error)
func (*CiphertextMessage) Serialize ¶
func (c *CiphertextMessage) Serialize() ([]byte, error)
type CiphertextMessageType ¶
type CiphertextMessageType uint8
const ( CiphertextMessageTypeWhisper CiphertextMessageType = 2 CiphertextMessageTypePreKey CiphertextMessageType = 3 CiphertextMessageTypeSenderKey CiphertextMessageType = 7 CiphertextMessageTypePlaintext CiphertextMessageType = 8 )
type DecryptionErrorMessage ¶
type DecryptionErrorMessage struct {
// contains filtered or unexported fields
}
func DecryptionErrorMessageFromSerializedContent ¶
func DecryptionErrorMessageFromSerializedContent(serialized []byte) (*DecryptionErrorMessage, error)
func DeserializeDecryptionErrorMessage ¶
func DeserializeDecryptionErrorMessage(messageBytes []byte) (*DecryptionErrorMessage, error)
func (*DecryptionErrorMessage) CancelFinalizer ¶
func (dem *DecryptionErrorMessage) CancelFinalizer()
func (*DecryptionErrorMessage) Clone ¶
func (dem *DecryptionErrorMessage) Clone() (*DecryptionErrorMessage, error)
func (*DecryptionErrorMessage) Destroy ¶
func (dem *DecryptionErrorMessage) Destroy() error
func (*DecryptionErrorMessage) GetDeviceID ¶
func (dem *DecryptionErrorMessage) GetDeviceID() (uint32, error)
func (*DecryptionErrorMessage) GetRatchetKey ¶
func (dem *DecryptionErrorMessage) GetRatchetKey() (*PublicKey, error)
func (*DecryptionErrorMessage) GetTimestamp ¶
func (dem *DecryptionErrorMessage) GetTimestamp() (time.Time, error)
func (*DecryptionErrorMessage) Serialize ¶
func (dem *DecryptionErrorMessage) Serialize() ([]byte, error)
type DeviceTransferKey ¶
type DeviceTransferKey struct {
// contains filtered or unexported fields
}
func GenerateDeviceTransferKey ¶
func GenerateDeviceTransferKey() (*DeviceTransferKey, error)
func (*DeviceTransferKey) GenerateCertificate ¶
func (dtk *DeviceTransferKey) GenerateCertificate(name string, days int) ([]byte, error)
func (*DeviceTransferKey) PrivateKeyMaterial ¶
func (dtk *DeviceTransferKey) PrivateKeyMaterial() []byte
type ErrorCode ¶
type ErrorCode int
const ( ErrorCodeUnknownError ErrorCode = 1 ErrorCodeInvalidState ErrorCode = 2 ErrorCodeInternalError ErrorCode = 3 ErrorCodeNullParameter ErrorCode = 4 ErrorCodeInvalidArgument ErrorCode = 5 ErrorCodeInvalidType ErrorCode = 6 ErrorCodeInvalidUtf8String ErrorCode = 7 ErrorCodeProtobufError ErrorCode = 10 ErrorCodeLegacyCiphertextVersion ErrorCode = 21 ErrorCodeUnknownCiphertextVersion ErrorCode = 22 ErrorCodeUnrecognizedMessageVersion ErrorCode = 23 ErrorCodeInvalidMessage ErrorCode = 30 ErrorCodeSealedSenderSelfSend ErrorCode = 31 ErrorCodeInvalidKey ErrorCode = 40 ErrorCodeInvalidSignature ErrorCode = 41 ErrorCodeInvalidAttestationData ErrorCode = 42 ErrorCodeFingerprintVersionMismatch ErrorCode = 51 ErrorCodeFingerprintParsingError ErrorCode = 52 ErrorCodeUntrustedIdentity ErrorCode = 60 ErrorCodeInvalidKeyIdentifier ErrorCode = 70 ErrorCodeSessionNotFound ErrorCode = 80 ErrorCodeInvalidRegistrationId ErrorCode = 81 ErrorCodeInvalidSession ErrorCode = 82 ErrorCodeInvalidSenderKeySession ErrorCode = 83 ErrorCodeDuplicatedMessage ErrorCode = 90 ErrorCodeCallbackError ErrorCode = 100 ErrorCodeVerificationFailure ErrorCode = 110 )
type ExpiringProfileKeyCredential ¶ added in v0.6.0
type ExpiringProfileKeyCredential [C.SignalEXPIRING_PROFILE_KEY_CREDENTIAL_LEN]byte
func ReceiveExpiringProfileKeyCredential ¶ added in v0.6.0
func ReceiveExpiringProfileKeyCredential(spp ServerPublicParams, requestContext *ProfileKeyCredentialRequestContext, response *ExpiringProfileKeyCredentialResponse, currentTimeInSeconds uint64) (*ExpiringProfileKeyCredential, error)
type ExpiringProfileKeyCredentialResponse ¶ added in v0.6.0
type ExpiringProfileKeyCredentialResponse [C.SignalEXPIRING_PROFILE_KEY_CREDENTIAL_RESPONSE_LEN]byte
func NewExpiringProfileKeyCredentialResponse ¶ added in v0.6.0
func NewExpiringProfileKeyCredentialResponse(b []byte) (*ExpiringProfileKeyCredentialResponse, error)
type Fingerprint ¶
type Fingerprint struct {
// contains filtered or unexported fields
}
func NewFingerprint ¶
func NewFingerprint(iterations, version FingerprintVersion, localIdentifier []byte, localKey *PublicKey, remoteIdentifier []byte, remoteKey *PublicKey) (*Fingerprint, error)
func (*Fingerprint) Clone ¶
func (f *Fingerprint) Clone() (*Fingerprint, error)
func (*Fingerprint) Compare ¶
func (f *Fingerprint) Compare(fingerprint1, fingerprint2 []byte) (bool, error)
func (*Fingerprint) Destroy ¶
func (f *Fingerprint) Destroy() error
func (*Fingerprint) DisplayString ¶
func (f *Fingerprint) DisplayString() (string, error)
func (*Fingerprint) ScannableEncoding ¶
func (f *Fingerprint) ScannableEncoding() ([]byte, error)
type FingerprintVersion ¶
type FingerprintVersion uint32
const ( FingerprintVersionV1 FingerprintVersion = 1 FingerprintVersionV2 FingerprintVersion = 2 )
type GroupIdentifier ¶
type GroupIdentifier [C.SignalGROUP_IDENTIFIER_LEN]byte
func GetGroupIdentifier ¶
func GetGroupIdentifier(groupPublicParams GroupPublicParams) (*GroupIdentifier, error)
type GroupMasterKey ¶
type GroupMasterKey [GroupMasterKeyLength]byte
type GroupPublicParams ¶
type GroupPublicParams [C.SignalGROUP_PUBLIC_PARAMS_LEN]byte
type GroupSecretParams ¶
type GroupSecretParams [C.SignalGROUP_SECRET_PARAMS_LEN]byte
func DeriveGroupSecretParamsFromMasterKey ¶
func DeriveGroupSecretParamsFromMasterKey(groupMasterKey GroupMasterKey) (GroupSecretParams, error)
func GenerateGroupSecretParams ¶
func GenerateGroupSecretParams() (GroupSecretParams, error)
func GenerateGroupSecretParamsWithRandomness ¶
func GenerateGroupSecretParamsWithRandomness(randomness Randomness) (GroupSecretParams, error)
func (*GroupSecretParams) CreateExpiringProfileKeyCredentialPresentation ¶ added in v0.6.0
func (gsp *GroupSecretParams) CreateExpiringProfileKeyCredentialPresentation(spp ServerPublicParams, credential ExpiringProfileKeyCredential) (*ProfileKeyCredentialPresentation, error)
func (*GroupSecretParams) DecryptBlobWithPadding ¶
func (gsp *GroupSecretParams) DecryptBlobWithPadding(blob []byte) ([]byte, error)
func (*GroupSecretParams) DecryptProfileKey ¶
func (gsp *GroupSecretParams) DecryptProfileKey(ciphertextProfileKey ProfileKeyCiphertext, u uuid.UUID) (*ProfileKey, error)
func (*GroupSecretParams) DecryptServiceID ¶ added in v0.6.0
func (gsp *GroupSecretParams) DecryptServiceID(ciphertextServiceID UUIDCiphertext) (ServiceID, error)
func (*GroupSecretParams) EncryptBlobWithPaddingDeterministic ¶ added in v0.6.0
func (gsp *GroupSecretParams) EncryptBlobWithPaddingDeterministic(randomness Randomness, plaintext []byte, padding_len uint32) ([]byte, error)
func (*GroupSecretParams) EncryptProfileKey ¶ added in v0.6.0
func (gsp *GroupSecretParams) EncryptProfileKey(profileKey ProfileKey, u uuid.UUID) (*ProfileKeyCiphertext, error)
func (*GroupSecretParams) EncryptServiceID ¶ added in v0.6.0
func (gsp *GroupSecretParams) EncryptServiceID(serviceID ServiceID) (*UUIDCiphertext, error)
func (*GroupSecretParams) GetMasterKey ¶ added in v0.6.0
func (gsp *GroupSecretParams) GetMasterKey() (*GroupMasterKey, error)
func (*GroupSecretParams) GetPublicParams ¶
func (gsp *GroupSecretParams) GetPublicParams() (*GroupPublicParams, error)
type HSMEnclaveClient ¶
type HSMEnclaveClient struct {
// contains filtered or unexported fields
}
func NewHSMEnclaveClient ¶
func NewHSMEnclaveClient(trustedPublicKey, trustedCodeHashes []byte) (*HSMEnclaveClient, error)
func (*HSMEnclaveClient) CompleteHandshake ¶
func (hsm *HSMEnclaveClient) CompleteHandshake(handshakeReceived []byte) error
func (*HSMEnclaveClient) Destroy ¶
func (hsm *HSMEnclaveClient) Destroy() error
func (*HSMEnclaveClient) EstablishedReceive ¶
func (hsm *HSMEnclaveClient) EstablishedReceive(ciphertext []byte) ([]byte, error)
func (*HSMEnclaveClient) EstablishedSend ¶
func (hsm *HSMEnclaveClient) EstablishedSend(plaintext []byte) ([]byte, error)
func (*HSMEnclaveClient) InitialRequest ¶
func (hsm *HSMEnclaveClient) InitialRequest() ([]byte, error)
type IdentityKey ¶
type IdentityKey struct {
// contains filtered or unexported fields
}
func DeserializeIdentityKey ¶
func DeserializeIdentityKey(bytes []byte) (*IdentityKey, error)
func NewIdentityKeyFromBytes ¶
func NewIdentityKeyFromBytes(bytes []byte) (*IdentityKey, error)
func NewIdentityKeyFromPublicKey ¶
func NewIdentityKeyFromPublicKey(publicKey *PublicKey) (*IdentityKey, error)
func (*IdentityKey) Equal ¶
func (i *IdentityKey) Equal(other *IdentityKey) (bool, error)
func (*IdentityKey) Serialize ¶
func (i *IdentityKey) Serialize() ([]byte, error)
func (*IdentityKey) TrySerialize ¶ added in v0.6.0
func (i *IdentityKey) TrySerialize() []byte
func (*IdentityKey) VerifyAlternateIdentity ¶
func (i *IdentityKey) VerifyAlternateIdentity(other *IdentityKey, signature []byte) (bool, error)
type IdentityKeyPair ¶
type IdentityKeyPair struct {
// contains filtered or unexported fields
}
func DeserializeIdentityKeyPair ¶
func DeserializeIdentityKeyPair(bytes []byte) (*IdentityKeyPair, error)
func GenerateIdentityKeyPair ¶
func GenerateIdentityKeyPair() (*IdentityKeyPair, error)
func NewIdentityKeyPair ¶
func NewIdentityKeyPair(publicKey *PublicKey, privateKey *PrivateKey) (*IdentityKeyPair, error)
func (*IdentityKeyPair) GetIdentityKey ¶
func (i *IdentityKeyPair) GetIdentityKey() *IdentityKey
func (*IdentityKeyPair) GetPrivateKey ¶
func (i *IdentityKeyPair) GetPrivateKey() *PrivateKey
func (*IdentityKeyPair) GetPublicKey ¶
func (i *IdentityKeyPair) GetPublicKey() *PublicKey
func (*IdentityKeyPair) Serialize ¶
func (i *IdentityKeyPair) Serialize() ([]byte, error)
func (*IdentityKeyPair) SignAlternateIdentity ¶
func (i *IdentityKeyPair) SignAlternateIdentity(other *IdentityKey) ([]byte, error)
type IdentityKeyStore ¶
type IdentityKeyStore interface { GetIdentityKeyPair(ctx context.Context) (*IdentityKeyPair, error) GetLocalRegistrationID(ctx context.Context) (uint32, error) SaveIdentityKey(ctx context.Context, theirServiceID ServiceID, identityKey *IdentityKey) (bool, error) GetIdentityKey(ctx context.Context, theirServiceID ServiceID) (*IdentityKey, error) IsTrustedIdentity(ctx context.Context, theirServiceID ServiceID, identityKey *IdentityKey, direction SignalDirection) (bool, error) }
type KyberKeyPair ¶
type KyberKeyPair struct {
// contains filtered or unexported fields
}
func KyberKeyPairGenerate ¶
func KyberKeyPairGenerate() (*KyberKeyPair, error)
func (*KyberKeyPair) CancelFinalizer ¶
func (kp *KyberKeyPair) CancelFinalizer()
func (*KyberKeyPair) Destroy ¶
func (kp *KyberKeyPair) Destroy() error
func (*KyberKeyPair) GetPublicKey ¶
func (kp *KyberKeyPair) GetPublicKey() (*KyberPublicKey, error)
type KyberPreKeyRecord ¶
type KyberPreKeyRecord struct {
// contains filtered or unexported fields
}
func DeserializeKyberPreKeyRecord ¶
func DeserializeKyberPreKeyRecord(serialized []byte) (*KyberPreKeyRecord, error)
func NewKyberPreKeyRecord ¶
func NewKyberPreKeyRecord(id uint32, timestamp time.Time, keyPair *KyberKeyPair, signature []byte) (*KyberPreKeyRecord, error)
func (*KyberPreKeyRecord) CancelFinalizer ¶
func (kpkr *KyberPreKeyRecord) CancelFinalizer()
func (*KyberPreKeyRecord) Clone ¶
func (kpkr *KyberPreKeyRecord) Clone() (*KyberPreKeyRecord, error)
func (*KyberPreKeyRecord) Destroy ¶
func (kpkr *KyberPreKeyRecord) Destroy() error
func (*KyberPreKeyRecord) GetID ¶
func (kpkr *KyberPreKeyRecord) GetID() (uint32, error)
func (*KyberPreKeyRecord) GetPublicKey ¶
func (kpkr *KyberPreKeyRecord) GetPublicKey() (*KyberPublicKey, error)
func (*KyberPreKeyRecord) GetSecretKey ¶
func (kpkr *KyberPreKeyRecord) GetSecretKey() (*KyberSecretKey, error)
func (*KyberPreKeyRecord) GetSignature ¶
func (kpkr *KyberPreKeyRecord) GetSignature() ([]byte, error)
func (*KyberPreKeyRecord) GetTimestamp ¶
func (kpkr *KyberPreKeyRecord) GetTimestamp() (time.Time, error)
func (*KyberPreKeyRecord) Serialize ¶
func (kpkr *KyberPreKeyRecord) Serialize() ([]byte, error)
type KyberPreKeyStore ¶
type KyberPublicKey ¶
type KyberPublicKey struct {
// contains filtered or unexported fields
}
func DeserializeKyberPublicKey ¶
func DeserializeKyberPublicKey(serialized []byte) (*KyberPublicKey, error)
func (*KyberPublicKey) CancelFinalizer ¶
func (k *KyberPublicKey) CancelFinalizer()
func (*KyberPublicKey) Destroy ¶
func (k *KyberPublicKey) Destroy() error
func (*KyberPublicKey) Serialize ¶
func (kp *KyberPublicKey) Serialize() ([]byte, error)
type KyberSecretKey ¶
type KyberSecretKey struct {
// contains filtered or unexported fields
}
func (*KyberSecretKey) CancelFinalizer ¶
func (k *KyberSecretKey) CancelFinalizer()
func (*KyberSecretKey) Destroy ¶
func (k *KyberSecretKey) Destroy() error
type Message ¶
type Message struct {
// contains filtered or unexported fields
}
func DeserializeMessage ¶
func (*Message) CancelFinalizer ¶
func (m *Message) CancelFinalizer()
func (*Message) GetCounter ¶
func (*Message) GetMessageVersion ¶
type NotarySignature ¶
type NotarySignature [C.SignalSIGNATURE_LEN]byte
type PlaintextContent ¶
type PlaintextContent struct {
// contains filtered or unexported fields
}
func DeserializePlaintextContent ¶
func DeserializePlaintextContent(plaintextContentBytes []byte) (*PlaintextContent, error)
func PlaintextContentFromDecryptionErrorMessage ¶
func PlaintextContentFromDecryptionErrorMessage(message *DecryptionErrorMessage) (*PlaintextContent, error)
func (*PlaintextContent) CancelFinalizer ¶
func (pc *PlaintextContent) CancelFinalizer()
func (*PlaintextContent) Clone ¶
func (pc *PlaintextContent) Clone() (*PlaintextContent, error)
func (*PlaintextContent) Destroy ¶
func (pc *PlaintextContent) Destroy() error
func (*PlaintextContent) GetBody ¶
func (pc *PlaintextContent) GetBody() ([]byte, error)
func (*PlaintextContent) Serialize ¶
func (pc *PlaintextContent) Serialize() ([]byte, error)
type PreKeyBundle ¶
type PreKeyBundle struct {
// contains filtered or unexported fields
}
func NewPreKeyBundle ¶
func NewPreKeyBundle( registrationID uint32, deviceID uint32, preKeyID uint32, preKey *PublicKey, signedPreKeyID uint32, signedPreKey *PublicKey, signedPreKeySignature []byte, kyberPreKeyID uint32, kyberPreKey *KyberPublicKey, kyberPreKeySignature []byte, identityKey *IdentityKey, ) (*PreKeyBundle, error)
func (*PreKeyBundle) CancelFinalizer ¶
func (pkb *PreKeyBundle) CancelFinalizer()
func (*PreKeyBundle) Clone ¶
func (pkb *PreKeyBundle) Clone() (*PreKeyBundle, error)
func (*PreKeyBundle) Destroy ¶
func (pkb *PreKeyBundle) Destroy() error
func (*PreKeyBundle) GetIdentityKey ¶
func (pkb *PreKeyBundle) GetIdentityKey() (*IdentityKey, error)
type PreKeyMessage ¶
type PreKeyMessage struct {
// contains filtered or unexported fields
}
func DeserializePreKeyMessage ¶
func DeserializePreKeyMessage(serialized []byte) (*PreKeyMessage, error)
func (*PreKeyMessage) CancelFinalizer ¶
func (m *PreKeyMessage) CancelFinalizer()
func (*PreKeyMessage) Clone ¶
func (m *PreKeyMessage) Clone() (*PreKeyMessage, error)
func (*PreKeyMessage) Destroy ¶
func (m *PreKeyMessage) Destroy() error
func (*PreKeyMessage) GetBaseKey ¶
func (m *PreKeyMessage) GetBaseKey() (*PublicKey, error)
func (*PreKeyMessage) GetIdentityKey ¶
func (m *PreKeyMessage) GetIdentityKey() (*IdentityKey, error)
func (*PreKeyMessage) GetPreKeyID ¶
func (m *PreKeyMessage) GetPreKeyID() (*uint32, error)
func (*PreKeyMessage) GetRegistrationID ¶
func (m *PreKeyMessage) GetRegistrationID() (uint32, error)
func (*PreKeyMessage) GetSignalMessage ¶
func (m *PreKeyMessage) GetSignalMessage() (*Message, error)
func (*PreKeyMessage) GetSignedPreKeyID ¶
func (m *PreKeyMessage) GetSignedPreKeyID() (uint32, error)
func (*PreKeyMessage) GetVersion ¶
func (m *PreKeyMessage) GetVersion() (uint32, error)
func (*PreKeyMessage) Serialize ¶
func (m *PreKeyMessage) Serialize() ([]byte, error)
type PreKeyRecord ¶
type PreKeyRecord struct {
// contains filtered or unexported fields
}
func DeserializePreKeyRecord ¶
func DeserializePreKeyRecord(serialized []byte) (*PreKeyRecord, error)
func NewPreKeyRecord ¶
func NewPreKeyRecord(id uint32, publicKey *PublicKey, privateKey *PrivateKey) (*PreKeyRecord, error)
func NewPreKeyRecordFromPrivateKey ¶
func NewPreKeyRecordFromPrivateKey(id uint32, privateKey *PrivateKey) (*PreKeyRecord, error)
func (*PreKeyRecord) CancelFinalizer ¶
func (pkr *PreKeyRecord) CancelFinalizer()
func (*PreKeyRecord) Clone ¶
func (pkr *PreKeyRecord) Clone() (*PreKeyRecord, error)
func (*PreKeyRecord) Destroy ¶
func (pkr *PreKeyRecord) Destroy() error
func (*PreKeyRecord) GetID ¶
func (pkr *PreKeyRecord) GetID() (uint32, error)
func (*PreKeyRecord) GetPrivateKey ¶
func (pkr *PreKeyRecord) GetPrivateKey() (*PrivateKey, error)
func (*PreKeyRecord) GetPublicKey ¶
func (pkr *PreKeyRecord) GetPublicKey() (*PublicKey, error)
func (*PreKeyRecord) Serialize ¶
func (pkr *PreKeyRecord) Serialize() ([]byte, error)
type PreKeyStore ¶
type PrivateKey ¶
type PrivateKey struct {
// contains filtered or unexported fields
}
func DeserializePrivateKey ¶
func DeserializePrivateKey(keyData []byte) (*PrivateKey, error)
func GeneratePrivateKey ¶
func GeneratePrivateKey() (*PrivateKey, error)
func (*PrivateKey) CancelFinalizer ¶
func (pk *PrivateKey) CancelFinalizer()
func (*PrivateKey) Clone ¶
func (pk *PrivateKey) Clone() (*PrivateKey, error)
func (*PrivateKey) Destroy ¶
func (pk *PrivateKey) Destroy() error
func (*PrivateKey) GetPublicKey ¶
func (pk *PrivateKey) GetPublicKey() (*PublicKey, error)
func (*PrivateKey) Serialize ¶
func (pk *PrivateKey) Serialize() ([]byte, error)
type ProfileKey ¶
type ProfileKey [ProfileKeyLength]byte
func DeserializeProfileKey ¶ added in v0.6.0
func DeserializeProfileKey(bytes []byte) (*ProfileKey, error)
func (*ProfileKey) DeriveAccessKey ¶
func (pk *ProfileKey) DeriveAccessKey() (*AccessKey, error)
func (*ProfileKey) GetCommitment ¶
func (pk *ProfileKey) GetCommitment(u uuid.UUID) (*ProfileKeyCommitment, error)
func (*ProfileKey) GetProfileKeyVersion ¶
func (pk *ProfileKey) GetProfileKeyVersion(u uuid.UUID) (*ProfileKeyVersion, error)
func (*ProfileKey) IsEmpty ¶ added in v0.5.1
func (pk *ProfileKey) IsEmpty() bool
func (*ProfileKey) Slice ¶
func (pk *ProfileKey) Slice() []byte
type ProfileKeyCiphertext ¶
type ProfileKeyCiphertext [C.SignalPROFILE_KEY_CIPHERTEXT_LEN]byte
type ProfileKeyCommitment ¶
type ProfileKeyCommitment [C.SignalPROFILE_KEY_COMMITMENT_LEN]byte
type ProfileKeyCredentialPresentation ¶
type ProfileKeyCredentialPresentation []byte
func (ProfileKeyCredentialPresentation) CheckValidContents ¶ added in v0.6.0
func (a ProfileKeyCredentialPresentation) CheckValidContents() error
func (ProfileKeyCredentialPresentation) ProfileKeyCiphertext ¶ added in v0.6.0
func (a ProfileKeyCredentialPresentation) ProfileKeyCiphertext() (ProfileKeyCiphertext, error)
func (ProfileKeyCredentialPresentation) UUIDCiphertext ¶ added in v0.6.0
func (a ProfileKeyCredentialPresentation) UUIDCiphertext() (UUIDCiphertext, error)
type ProfileKeyCredentialRequest ¶
type ProfileKeyCredentialRequest [C.SignalPROFILE_KEY_CREDENTIAL_REQUEST_LEN]byte
type ProfileKeyCredentialRequestContext ¶
type ProfileKeyCredentialRequestContext [C.SignalPROFILE_KEY_CREDENTIAL_REQUEST_CONTEXT_LEN]byte
func CreateProfileKeyCredentialRequestContext ¶
func CreateProfileKeyCredentialRequestContext(serverPublicParams ServerPublicParams, u uuid.UUID, profileKey ProfileKey) (*ProfileKeyCredentialRequestContext, error)
func (*ProfileKeyCredentialRequestContext) ProfileKeyCredentialRequestContextGetRequest ¶
func (p *ProfileKeyCredentialRequestContext) ProfileKeyCredentialRequestContextGetRequest() (*ProfileKeyCredentialRequest, error)
type ProfileKeyCredentialResponse ¶
type ProfileKeyCredentialResponse []byte
type ProfileKeyVersion ¶
type ProfileKeyVersion [C.SignalPROFILE_KEY_VERSION_ENCODED_LEN]byte
func (*ProfileKeyVersion) String ¶
func (pv *ProfileKeyVersion) String() string
type PublicKey ¶
type PublicKey struct {
// contains filtered or unexported fields
}
func DeserializePublicKey ¶
func (*PublicKey) CancelFinalizer ¶
func (k *PublicKey) CancelFinalizer()
type Randomness ¶
type Randomness [C.SignalRANDOMNESS_LEN]byte
func GenerateRandomness ¶
func GenerateRandomness() Randomness
type SGXClientState ¶
type SGXClientState struct {
// contains filtered or unexported fields
}
func NewCDS2ClientState ¶
func NewCDS2ClientState(mrenclave, attestationMessage []byte, currentTime time.Time) (*SGXClientState, error)
func (*SGXClientState) CompleteHandshake ¶
func (cds *SGXClientState) CompleteHandshake(handshakeReceived []byte) error
func (*SGXClientState) Destroy ¶
func (cds *SGXClientState) Destroy() error
func (*SGXClientState) EstablishedReceive ¶
func (cds *SGXClientState) EstablishedReceive(ciphertext []byte) ([]byte, error)
func (*SGXClientState) EstablishedSend ¶
func (cds *SGXClientState) EstablishedSend(plaintext []byte) ([]byte, error)
func (*SGXClientState) InitialRequest ¶
func (cds *SGXClientState) InitialRequest() ([]byte, error)
type SealedSenderAddress ¶
func NewSealedSenderAddress ¶
func NewSealedSenderAddress(e164 string, uuid uuid.UUID, deviceID uint32) *SealedSenderAddress
type SealedSenderResult ¶
type SealedSenderResult struct { Message []byte Sender SealedSenderAddress }
func SealedSenderDecrypt ¶
func SealedSenderDecrypt( ctx context.Context, ciphertext []byte, localAddress *SealedSenderAddress, trustRoot *PublicKey, timestamp time.Time, sessionStore SessionStore, identityStore IdentityKeyStore, preKeyStore PreKeyStore, signedPreKeyStore SignedPreKeyStore, ) (result SealedSenderResult, err error)
type SenderCertificate ¶
type SenderCertificate struct {
// contains filtered or unexported fields
}
func DeserializeSenderCertificate ¶
func DeserializeSenderCertificate(serialized []byte) (*SenderCertificate, error)
func NewSenderCertificate ¶
func NewSenderCertificate(sender *SealedSenderAddress, publicKey *PublicKey, expiration time.Time, signerCertificate *ServerCertificate, signerKey *PrivateKey) (*SenderCertificate, error)
NewSenderCertificate should only be used for testing (at least according to the Swift bindings).
func (*SenderCertificate) CancelFinalizer ¶
func (sc *SenderCertificate) CancelFinalizer()
func (*SenderCertificate) Clone ¶
func (sc *SenderCertificate) Clone() (*SenderCertificate, error)
func (*SenderCertificate) Destroy ¶
func (sc *SenderCertificate) Destroy() error
func (*SenderCertificate) GetCertificate ¶
func (sc *SenderCertificate) GetCertificate() ([]byte, error)
func (*SenderCertificate) GetDeviceID ¶
func (sc *SenderCertificate) GetDeviceID() (uint32, error)
func (*SenderCertificate) GetExpiration ¶
func (sc *SenderCertificate) GetExpiration() (time.Time, error)
func (*SenderCertificate) GetKey ¶
func (sc *SenderCertificate) GetKey() (*PublicKey, error)
func (*SenderCertificate) GetSenderE164 ¶
func (sc *SenderCertificate) GetSenderE164() (string, error)
func (*SenderCertificate) GetSenderUUID ¶
func (sc *SenderCertificate) GetSenderUUID() (uuid.UUID, error)
func (*SenderCertificate) GetServerCertificate ¶
func (sc *SenderCertificate) GetServerCertificate() (*ServerCertificate, error)
func (*SenderCertificate) GetSignature ¶
func (sc *SenderCertificate) GetSignature() ([]byte, error)
func (*SenderCertificate) Serialize ¶
func (sc *SenderCertificate) Serialize() ([]byte, error)
type SenderKeyDistributionMessage ¶
type SenderKeyDistributionMessage struct {
// contains filtered or unexported fields
}
func DeserializeSenderKeyDistributionMessage ¶
func DeserializeSenderKeyDistributionMessage(serialized []byte) (*SenderKeyDistributionMessage, error)
func NewSenderKeyDistributionMessage ¶
func NewSenderKeyDistributionMessage(ctx context.Context, sender *Address, distributionID uuid.UUID, store SenderKeyStore) (*SenderKeyDistributionMessage, error)
func (*SenderKeyDistributionMessage) CancelFinalizer ¶
func (sc *SenderKeyDistributionMessage) CancelFinalizer()
func (*SenderKeyDistributionMessage) Destroy ¶
func (sc *SenderKeyDistributionMessage) Destroy() error
func (*SenderKeyDistributionMessage) Process ¶
func (sc *SenderKeyDistributionMessage) Process(ctx context.Context, sender *Address, store SenderKeyStore) error
func (*SenderKeyDistributionMessage) Serialize ¶
func (sc *SenderKeyDistributionMessage) Serialize() ([]byte, error)
type SenderKeyRecord ¶
type SenderKeyRecord struct {
// contains filtered or unexported fields
}
func DeserializeSenderKeyRecord ¶
func DeserializeSenderKeyRecord(serialized []byte) (*SenderKeyRecord, error)
func (*SenderKeyRecord) CancelFinalizer ¶
func (skr *SenderKeyRecord) CancelFinalizer()
func (*SenderKeyRecord) Clone ¶
func (skr *SenderKeyRecord) Clone() (*SenderKeyRecord, error)
func (*SenderKeyRecord) Destroy ¶
func (skr *SenderKeyRecord) Destroy() error
func (*SenderKeyRecord) Serialize ¶
func (skr *SenderKeyRecord) Serialize() ([]byte, error)
type SenderKeyStore ¶
type ServerCertificate ¶
type ServerCertificate struct {
// contains filtered or unexported fields
}
func DeserializeServerCertificate ¶
func DeserializeServerCertificate(serialized []byte) (*ServerCertificate, error)
func NewServerCertificate ¶
func NewServerCertificate(keyID uint32, publicKey *PublicKey, trustRoot *PrivateKey) (*ServerCertificate, error)
NewServerCertificate should only be used for testing (at least according to the Swift bindings).
func (*ServerCertificate) CancelFinalizer ¶
func (sc *ServerCertificate) CancelFinalizer()
func (*ServerCertificate) Clone ¶
func (sc *ServerCertificate) Clone() (*ServerCertificate, error)
func (*ServerCertificate) Destroy ¶
func (sc *ServerCertificate) Destroy() error
func (*ServerCertificate) GetCertificate ¶
func (sc *ServerCertificate) GetCertificate() ([]byte, error)
func (*ServerCertificate) GetKey ¶
func (sc *ServerCertificate) GetKey() (*PublicKey, error)
func (*ServerCertificate) GetKeyID ¶
func (sc *ServerCertificate) GetKeyID() (uint32, error)
func (*ServerCertificate) GetSignature ¶
func (sc *ServerCertificate) GetSignature() ([]byte, error)
func (*ServerCertificate) Serialize ¶
func (sc *ServerCertificate) Serialize() ([]byte, error)
type ServerPublicParams ¶
type ServerPublicParams [C.SignalSERVER_PUBLIC_PARAMS_LEN]byte
type ServiceID ¶ added in v0.6.0
type ServiceID struct { Type ServiceIDType UUID uuid.UUID }
var EmptyServiceID ServiceID
func NewACIServiceID ¶ added in v0.6.0
func NewPNIServiceID ¶ added in v0.6.0
func ServiceIDFromCFixedBytes ¶ added in v0.6.0
func ServiceIDFromCFixedBytes(serviceID *C.SignalServiceIdFixedWidthBinaryBytes) ServiceID
func ServiceIDFromString ¶ added in v0.6.0
func (ServiceID) CFixedBytes ¶ added in v0.6.0
func (s ServiceID) CFixedBytes() cPNIType
func (ServiceID) FixedBytes ¶ added in v0.6.0
func (s ServiceID) FixedBytes() *ServiceIDFixedBytes
func (ServiceID) MarshalZerologObject ¶ added in v0.6.0
type ServiceIDFixedBytes ¶ added in v0.6.0
type ServiceIDFixedBytes [17]byte
type ServiceIDType ¶ added in v0.6.0
type ServiceIDType byte
const ( ServiceIDTypeACI ServiceIDType = 0 ServiceIDTypePNI ServiceIDType = 1 )
func (ServiceIDType) GoString ¶ added in v0.6.0
func (st ServiceIDType) GoString() string
func (ServiceIDType) String ¶ added in v0.6.0
func (st ServiceIDType) String() string
type SessionRecord ¶
type SessionRecord struct {
// contains filtered or unexported fields
}
func DeserializeSessionRecord ¶
func DeserializeSessionRecord(serialized []byte) (*SessionRecord, error)
func (*SessionRecord) ArchiveCurrentState ¶
func (sr *SessionRecord) ArchiveCurrentState() error
func (*SessionRecord) CancelFinalizer ¶
func (sr *SessionRecord) CancelFinalizer()
func (*SessionRecord) Clone ¶
func (sr *SessionRecord) Clone() (*SessionRecord, error)
func (*SessionRecord) CurrentRatchetKeyMatches ¶
func (sr *SessionRecord) CurrentRatchetKeyMatches(key *PublicKey) (bool, error)
func (*SessionRecord) Destroy ¶
func (sr *SessionRecord) Destroy() error
func (*SessionRecord) GetLocalRegistrationID ¶
func (sr *SessionRecord) GetLocalRegistrationID() (uint32, error)
func (*SessionRecord) GetRemoteRegistrationID ¶
func (sr *SessionRecord) GetRemoteRegistrationID() (uint32, error)
func (*SessionRecord) HasCurrentState ¶
func (sr *SessionRecord) HasCurrentState() (bool, error)
func (*SessionRecord) Serialize ¶
func (sr *SessionRecord) Serialize() ([]byte, error)
type SessionStore ¶
type SessionStore interface { LoadSession(ctx context.Context, address *Address) (*SessionRecord, error) StoreSession(ctx context.Context, address *Address, record *SessionRecord) error }
type SignalDirection ¶
type SignalDirection uint
const ( SignalDirectionSending SignalDirection = 0 SignalDirectionReceiving SignalDirection = 1 )
type SignalError ¶
func (*SignalError) Error ¶
func (e *SignalError) Error() string
type SignedPreKeyRecord ¶
type SignedPreKeyRecord struct {
// contains filtered or unexported fields
}
func DeserializeSignedPreKeyRecord ¶
func DeserializeSignedPreKeyRecord(serialized []byte) (*SignedPreKeyRecord, error)
func NewSignedPreKeyRecord ¶
func NewSignedPreKeyRecord(id uint32, timestamp time.Time, publicKey *PublicKey, privateKey *PrivateKey, signature []byte) (*SignedPreKeyRecord, error)
func NewSignedPreKeyRecordFromPrivateKey ¶
func NewSignedPreKeyRecordFromPrivateKey(id uint32, timestamp time.Time, privateKey *PrivateKey, signature []byte) (*SignedPreKeyRecord, error)
func (*SignedPreKeyRecord) CancelFinalizer ¶
func (spkr *SignedPreKeyRecord) CancelFinalizer()
func (*SignedPreKeyRecord) Clone ¶
func (spkr *SignedPreKeyRecord) Clone() (*SignedPreKeyRecord, error)
func (*SignedPreKeyRecord) Destroy ¶
func (spkr *SignedPreKeyRecord) Destroy() error
func (*SignedPreKeyRecord) GetID ¶
func (spkr *SignedPreKeyRecord) GetID() (uint32, error)
func (*SignedPreKeyRecord) GetPrivateKey ¶
func (spkr *SignedPreKeyRecord) GetPrivateKey() (*PrivateKey, error)
func (*SignedPreKeyRecord) GetPublicKey ¶
func (spkr *SignedPreKeyRecord) GetPublicKey() (*PublicKey, error)
func (*SignedPreKeyRecord) GetSignature ¶
func (spkr *SignedPreKeyRecord) GetSignature() ([]byte, error)
func (*SignedPreKeyRecord) GetTimestamp ¶
func (spkr *SignedPreKeyRecord) GetTimestamp() (time.Time, error)
func (*SignedPreKeyRecord) Serialize ¶
func (spkr *SignedPreKeyRecord) Serialize() ([]byte, error)
type SignedPreKeyStore ¶
type SignedPreKeyStore interface { LoadSignedPreKey(ctx context.Context, id uint32) (*SignedPreKeyRecord, error) StoreSignedPreKey(ctx context.Context, id uint32, signedPreKeyRecord *SignedPreKeyRecord) error }
type UUIDCiphertext ¶
type UUIDCiphertext [C.SignalUUID_CIPHERTEXT_LEN]byte
type UnidentifiedSenderMessageContent ¶
type UnidentifiedSenderMessageContent struct {
// contains filtered or unexported fields
}
func DeserializeUnidentifiedSenderMessageContent ¶
func DeserializeUnidentifiedSenderMessageContent(serialized []byte) (*UnidentifiedSenderMessageContent, error)
func NewUnidentifiedSenderMessageContent ¶
func NewUnidentifiedSenderMessageContent(message *CiphertextMessage, senderCertificate *SenderCertificate, contentHint UnidentifiedSenderMessageContentHint, groupID []byte) (*UnidentifiedSenderMessageContent, error)
func SealedSenderDecryptToUSMC ¶
func SealedSenderDecryptToUSMC( ctx context.Context, ciphertext []byte, identityStore IdentityKeyStore, ) (*UnidentifiedSenderMessageContent, error)
func (*UnidentifiedSenderMessageContent) CancelFinalizer ¶
func (usmc *UnidentifiedSenderMessageContent) CancelFinalizer()
func (*UnidentifiedSenderMessageContent) Destroy ¶
func (usmc *UnidentifiedSenderMessageContent) Destroy() error
func (*UnidentifiedSenderMessageContent) GetContentHint ¶
func (usmc *UnidentifiedSenderMessageContent) GetContentHint() (UnidentifiedSenderMessageContentHint, error)
func (*UnidentifiedSenderMessageContent) GetContents ¶
func (usmc *UnidentifiedSenderMessageContent) GetContents() ([]byte, error)
func (*UnidentifiedSenderMessageContent) GetMessageType ¶
func (usmc *UnidentifiedSenderMessageContent) GetMessageType() (CiphertextMessageType, error)
func (*UnidentifiedSenderMessageContent) GetSenderCertificate ¶
func (usmc *UnidentifiedSenderMessageContent) GetSenderCertificate() (*SenderCertificate, error)
func (*UnidentifiedSenderMessageContent) Serialize ¶
func (usmc *UnidentifiedSenderMessageContent) Serialize() ([]byte, error)
type UnidentifiedSenderMessageContentHint ¶
type UnidentifiedSenderMessageContentHint uint32
const ( UnidentifiedSenderMessageContentHintDefault UnidentifiedSenderMessageContentHint = 0 UnidentifiedSenderMessageContentHintResendable UnidentifiedSenderMessageContentHint = 1 UnidentifiedSenderMessageContentHintImplicit UnidentifiedSenderMessageContentHint = 2 )
type WrappedStore ¶
type WrappedStore[T any] struct { Store T Ctx *CallbackContext }
Source Files ¶
- address.go
- aes256gcmsiv.go
- authcredential.go
- buffer.go
- ciphertextmessage.go
- conversions.go
- decryptionerrormessage.go
- devicetransfer.go
- error.go
- fingerprint.go
- groupcipher.go
- groupsecretparams.go
- hsmenclave.go
- identitykey.go
- identitykeystore.go
- kdf.go
- kyberprekey.go
- kyberprekeystore.go
- logging.go
- message.go
- nocopy.go
- plaintextcontent.go
- prekey.go
- prekeybundle.go
- prekeymessage.go
- prekeystore.go
- privatekey.go
- profilekey.go
- protocol.go
- publickey.go
- sealedsender.go
- sendercertificate.go
- senderkeydistributionmessage.go
- senderkeyrecord.go
- senderkeystore.go
- servercertificate.go
- serviceid.go
- serviceid_gcc.go
- sessionrecord.go
- sessionstore.go
- sgxclient.go
- signedprekey.go
- signedprekeystore.go
- storeutil.go
- verifysignature.go
- version.go
Click to show internal directories.
Click to hide internal directories.