Documentation ¶
Index ¶
- type EncryptedP2PKey
- type EncryptedP2PKeyExport
- type Key
- func (k Key) GetPeerID() (models.PeerID, error)
- func (k Key) MustGetPeerID() models.PeerID
- func (k Key) ToEncryptedExport(auth string, scryptParams utils.ScryptParams) (export []byte, err error)
- func (k Key) ToEncryptedP2PKey(auth string, scryptParams utils.ScryptParams) (s EncryptedP2PKey, err error)
- type PublicKeyBytes
- func (PublicKeyBytes) GormDBDataType(db *gorm.DB, field *schema.Field) string
- func (PublicKeyBytes) GormDataType() string
- func (pkb PublicKeyBytes) MarshalJSON() ([]byte, error)
- func (pkb *PublicKeyBytes) Scan(value interface{}) error
- func (pkb PublicKeyBytes) String() string
- func (pkb *PublicKeyBytes) UnmarshalJSON(input []byte) error
- func (pkb PublicKeyBytes) Value() (driver.Value, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EncryptedP2PKey ¶
type EncryptedP2PKey struct { ID int32 `json:"id" gorm:"primary_key"` PeerID models.PeerID `json:"peerId"` PubKey PublicKeyBytes `json:"publicKey" gorm:"type:bytea"` EncryptedPrivKey []byte `json:"-"` CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt,omitempty"` DeletedAt gorm.DeletedAt `json:"deletedAt,omitempty"` }
func (EncryptedP2PKey) Decrypt ¶
func (ep2pk EncryptedP2PKey) Decrypt(auth string) (k Key, err error)
Decrypt returns the PrivateKey in e, decrypted via auth, or an error
func (EncryptedP2PKey) GetID ¶ added in v0.9.3
func (ep2pk EncryptedP2PKey) GetID() string
func (*EncryptedP2PKey) SetID ¶ added in v0.9.3
func (ep2pk *EncryptedP2PKey) SetID(value string) error
func (EncryptedP2PKey) TableName ¶
func (EncryptedP2PKey) TableName() string
type EncryptedP2PKeyExport ¶ added in v0.9.9
type EncryptedP2PKeyExport struct { PublicKey PublicKeyBytes `json:"publicKey"` PeerID models.PeerID `json:"peerID"` Crypto keystore.CryptoJSON `json:"crypto"` }
EncryptedP2PKeyExport represents the structure of P2P keys exported and imported to/from the disk
func (EncryptedP2PKeyExport) DecryptPrivateKey ¶ added in v0.9.9
func (export EncryptedP2PKeyExport) DecryptPrivateKey(auth string) (k *Key, err error)
DecryptPrivateKey returns the PrivateKey in export, decrypted via auth, or an error
type Key ¶
Key represents a libp2p private key
func (Key) MustGetPeerID ¶ added in v0.9.6
func (Key) ToEncryptedExport ¶ added in v0.9.9
func (Key) ToEncryptedP2PKey ¶
func (k Key) ToEncryptedP2PKey(auth string, scryptParams utils.ScryptParams) (s EncryptedP2PKey, err error)
type PublicKeyBytes ¶ added in v0.9.3
type PublicKeyBytes []byte
PublicKeyBytes is generated using cryptop2p.PubKey.Raw()
func (PublicKeyBytes) GormDBDataType ¶ added in v0.10.0
GormDBDataType gorm db data type
func (PublicKeyBytes) GormDataType ¶ added in v0.10.0
func (PublicKeyBytes) GormDataType() string
GormDataType gorm common data type
func (PublicKeyBytes) MarshalJSON ¶ added in v0.9.3
func (pkb PublicKeyBytes) MarshalJSON() ([]byte, error)
func (*PublicKeyBytes) Scan ¶ added in v0.10.0
func (pkb *PublicKeyBytes) Scan(value interface{}) error
func (PublicKeyBytes) String ¶ added in v0.9.3
func (pkb PublicKeyBytes) String() string
func (*PublicKeyBytes) UnmarshalJSON ¶ added in v0.9.3
func (pkb *PublicKeyBytes) UnmarshalJSON(input []byte) error
Click to show internal directories.
Click to hide internal directories.