Skip to content
Snippets Groups Projects
Select Git revision
  • 6306b1d649bb58c8e2ff2019c05cce09bd811027
  • release default
  • 11-22-implement-kv-interface-defined-in-collectiveversionedkvgo
  • master protected
  • XX-4688/DbEncoding
  • hotfix/update
  • @XX-4682/Files
  • hotfix/XX-4655
  • dev protected
  • project/HavenNotifications
  • XX-4602/SilentMessageType
  • jono/npmTest
  • wasmTest2
  • XX-4461/FileUpload
  • XX-4505/blockuser
  • XX-4441
  • Jakub/Emoji-CI-Test
  • testing/websockets
  • fastReg
  • fast-registration
  • NewHostPool
  • v0.3.22
  • v0.3.21
  • v0.3.20
  • v0.3.18
  • v0.3.17
  • v0.3.16
  • v0.3.15
  • v0.3.14
  • v0.3.13
  • v0.3.12
  • v0.3.11
  • v0.3.10
  • v0.3.9
  • v0.3.8
  • v0.3.7
  • v0.3.6
  • v0.3.5
  • v0.3.4
  • 812b395df518ce096d01d5292596ca26f8fe92d9c4487ddfa515e190a51aa1a1
  • 76ba08e2dfa1798412a265404fa271840b52c035869111fce8e8cdb23a036a5a
41 results

init.go

Blame
  • user.go 1.69 KiB
    ///////////////////////////////////////////////////////////////////////////////
    // Copyright © 2020 xx network SEZC                                          //
    //                                                                           //
    // Use of this source code is governed by a license that can be found in the //
    // LICENSE file                                                              //
    ///////////////////////////////////////////////////////////////////////////////
    
    package bindings
    
    import (
    	"gitlab.com/elixxir/client/interfaces/user"
    	"gitlab.com/xx_network/crypto/signature/rsa"
    )
    
    type User struct {
    	u *user.Info
    }
    
    func (u *User) GetTransmissionID() []byte {
    	return u.u.TransmissionID.Marshal()
    }
    
    func (u *User) GetReceptionID() []byte {
    	return u.u.ReceptionID.Marshal()
    }
    
    func (u *User) GetTransmissionSalt() []byte {
    	return u.u.TransmissionSalt
    }
    
    func (u *User) GetReceptionSalt() []byte {
    	return u.u.ReceptionSalt
    }
    
    func (u *User) GetTransmissionRSAPrivateKeyPem() []byte {
    	return rsa.CreatePrivateKeyPem(u.u.TransmissionRSA)
    }
    
    func (u *User) GetTransmissionRSAPublicKeyPem() []byte {
    	return rsa.CreatePublicKeyPem(u.u.TransmissionRSA.GetPublic())
    }
    
    func (u *User) GetReceptionRSAPrivateKeyPem() []byte {
    	return rsa.CreatePrivateKeyPem(u.u.ReceptionRSA)
    }
    
    func (u *User) GetReceptionRSAPublicKeyPem() []byte {
    	return rsa.CreatePublicKeyPem(u.u.ReceptionRSA.GetPublic())
    }
    
    func (u *User) IsPrecanned() bool {
    	return u.u.Precanned
    }
    
    func (u *User) GetE2EDhPrivateKey() []byte {
    	return u.u.E2eDhPrivateKey.Bytes()
    }
    
    func (u *User) GetE2EDhPublicKey() []byte {
    	return u.u.E2eDhPublicKey.Bytes()
    }
    
    func (u *User) GetContact() *Contact {
    	c := u.u.GetContact()
    	return &Contact{c: &c}
    }