Documentation
¶
Index ¶
- Constants
- func ConvertPubKeyToLibp2pPeerID(publicKey *secp256k1.PublicKey) (string, error)
- func ConvertPubKeyToLibp2pPubKey(publicKey *secp256k1.PublicKey) (*crypto.PubKey, error)
- func DecodeKey(serializedKey string) ([]byte, error)
- func DeserializePrivateKey(serializedKey string) (*secp256k1.PrivateKey, *secp256k1.PublicKey, error)
- func DeserializePublicKey(serializedKey string) (*secp256k1.PublicKey, error)
- func GeneratePrivateKey() (*secp256k1.PrivateKey, error)
- func SerializePrivateKey(privateKey *secp256k1.PrivateKey) (*string, error)
- func SerializePrivateKeyBech32(privateKey *secp256k1.PrivateKey) (*string, error)
- func SerializePublicKey(publicKey *secp256k1.PublicKey) (*string, error)
- func SerializePublicKeyBech32(publicKey *secp256k1.PublicKey) (*string, error)
- func SignCID(cid cid.Cid, privateKey *btcec.PrivateKey) (*schnorr.Signature, error)
- func SignData(data []byte, privateKey *btcec.PrivateKey) (*schnorr.Signature, error)
- func SignSerializedCid(serializedCid string, privateKey *btcec.PrivateKey) (*schnorr.Signature, error)
- func TrimPrivateKey(privateKey string) string
- func TrimPublicKey(publicKey string) string
- func VerifyCIDSignature(signature *schnorr.Signature, cid cid.Cid, publicKey *secp256k1.PublicKey) error
- func VerifySerializedCIDSignature(signature *schnorr.Signature, serializedCid string, ...) error
- func VerifySignature(signature *schnorr.Signature, data []byte, publicKey *secp256k1.PublicKey) error
Constants ¶
View Source
const PrivateKeyPrefix = "nsec1"
View Source
const PublicKeyPrefix = "npub1"
Variables ¶
This section is empty.
Functions ¶
func ConvertPubKeyToLibp2pPeerID ¶
ConvertPubKeyToLibp2pPeerID converts a public key directly to a peer ID string
func ConvertPubKeyToLibp2pPubKey ¶
ConvertPubKeyToLibp2pPubKey converts a public key directly to a libp2p public key
func DeserializePrivateKey ¶
func DeserializePublicKey ¶
func GeneratePrivateKey ¶
func GeneratePrivateKey() (*secp256k1.PrivateKey, error)
func SerializePrivateKey ¶
func SerializePrivateKey(privateKey *secp256k1.PrivateKey) (*string, error)
func SerializePrivateKeyBech32 ¶
func SerializePrivateKeyBech32(privateKey *secp256k1.PrivateKey) (*string, error)
func SignSerializedCid ¶
func TrimPrivateKey ¶
func TrimPublicKey ¶
func VerifyCIDSignature ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.