Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Index your code
hub
/
github.com/nats-io/nkeys
/ functions
Functions
128 in github.com/nats-io/nkeys
⨍
Functions
128
◇
Types & classes
7
↓ 24 callers
Method
PublicKey
()
nk/main.go:54
↓ 16 callers
Method
Seed
()
nk/main.go:53
↓ 13 callers
Function
Encode
Encode will encode a raw key or seed with the prefix and crc16 and then base32 encoded.
strkey.go:59
↓ 12 callers
Function
Decode
Decode will decode the base32 string and check crc16 and enforce the prefix is what is expected.
strkey.go:156
↓ 12 callers
Method
Sign
Sign is only supported on Non CurveKeyPairs
nkeys.go:30
↓ 11 callers
Function
CreateUser
CreateUser will create a User typed KeyPair.
nkeys.go:43
↓ 10 callers
Function
CreatePair
CreatePair will create a KeyPair based on the rand entropy and a type/prefix byte.
keypair.go:32
↓ 10 callers
Function
DecodeSeed
DecodeSeed will decode the base32 string and check crc16 and enforce the prefix is a seed and the subsequent type is a valid type.
strkey.go:173
↓ 10 callers
Method
Verify
Verify is only supported on Non CurveKeyPairs
nkeys.go:32
↓ 9 callers
Function
FromPublicKey
FromPublicKey will create a KeyPair capable of verifying signatures.
nkeys.go:68
↓ 9 callers
Function
FromSeed
FromSeed will create a KeyPair capable of signing and verifying signatures.
nkeys.go:77
↓ 8 callers
Method
String
()
strkey.go:291
↓ 8 callers
Function
decode
decode will decode the base32 and check crc16 and the prefix for validity.
strkey.go:133
↓ 7 callers
Function
EncodeSeed
EncodeSeed will encode a raw key with the prefix and then seed prefix and crc16 and then base32 encoded. `src` must be 32 bytes long (ed25519.SeedSize
strkey.go:90
↓ 7 callers
Method
Open
Open is only supported on CurveKey
nkeys.go:39
↓ 6 callers
Function
CreateAccount
CreateAccount will create an Account typed KeyPair.
nkeys.go:48
↓ 6 callers
Function
IsValidPublicKey
IsValidPublicKey will decode and verify that the string is a valid encoded public key.
strkey.go:214
↓ 5 callers
Function
CreateCurveKeys
CreateCurveKeys will create a Curve typed KeyPair.
xkeys.go:43
↓ 5 callers
Function
Prefix
Prefix returns PrefixBytes of its input
strkey.go:195
↓ 5 callers
Method
Seal
Seal is only supported on CurveKeyPair
nkeys.go:35
↓ 4 callers
Function
crc16
crc16 returns the 2-byte crc for the data provided.
crc16.go:54
↓ 4 callers
Method
keys
keys will return a 32 byte public key and a 64 byte private key utilizing the seed.
keypair.go:60
↓ 4 callers
Function
readKeyFile
(filename string)
nk/main.go:307
↓ 3 callers
Function
CreateCurveKeysWithRand
CreateCurveKeysWithRand will create a Curve typed KeyPair with specified rand source.
xkeys.go:49
↓ 3 callers
Function
ParseDecoratedNKey
ParseDecoratedNKey takes a creds file, finds the NKey portion and creates a key pair from it.
creds_utils.go:27
↓ 3 callers
Method
PrivateKey
()
nkeys.go:28
↓ 3 callers
Function
checkValidPrefixByte
checkValidPrefixByte returns an error if the provided value is not one of the defined valid prefix byte constants.
strkey.go:272
↓ 3 callers
Function
checkValidPublicPrefixByte
checkValidPublicPrefixByte returns an error if the provided value is not one of the public defined valid prefix byte constants.
strkey.go:283
↓ 3 callers
Function
testCurve
(t *testing.T, kp KeyPair)
xkeys_test.go:22
↓ 3 callers
Function
testSealOpen
(t *testing.T, prefixByte PrefixByte)
nkeys_test.go:749
↓ 3 callers
Function
validate
validate will check the calculated crc16 checksum for data against the expected.
crc16.go:63
↓ 2 callers
Function
CreateCluster
CreateCluster will create a Cluster typed KeyPair.
nkeys.go:58
↓ 2 callers
Function
CreateOperator
CreateOperator will create an Operator typed KeyPair.
nkeys.go:63
↓ 2 callers
Function
CreatePairWithRand
CreatePair will create a KeyPair based on the rand reader and a type/prefix byte. rand can be nil.
keypair.go:37
↓ 2 callers
Function
CreateServer
CreateServer will create a Server typed KeyPair.
nkeys.go:53
↓ 2 callers
Function
FromCurveSeed
Will create a curve key pair from seed.
xkeys.go:60
↓ 2 callers
Function
ParseDecoratedJWT
ParseDecoratedJWT takes a creds file and returns the JWT portion.
creds_utils.go:12
↓ 2 callers
Method
SealWithRand
SealWithRand is only supported on CurveKeyPair
nkeys.go:37
↓ 2 callers
Method
Wipe
()
nkeys.go:33
↓ 2 callers
Function
decodePubCurveKey
(src string, dest []byte)
xkeys.go:91
↓ 2 callers
Function
decodePublicKey
(public string)
strkey.go:219
↓ 2 callers
Function
encodeTestSeed
(public PrefixByte, src []byte)
nkeys_test.go:463
↓ 2 callers
Function
genKeyPair
(pre nkeys.PrefixByte, entropy string)
nk/main.go:226
↓ 2 callers
Function
preForType
(keyType string)
nk/main.go:204
↓ 1 callers
Function
CompatibleKeyPair
CompatibleKeyPair returns an error if the KeyPair doesn't match expected PrefixByte(s)
strkey.go:314
↓ 1 callers
Method
Error
()
errors.go:48
↓ 1 callers
Function
FromRawSeed
FromRawSeed will create a KeyPair from the raw 32 byte seed for a given type.
nkeys.go:90
↓ 1 callers
Function
IsValidEncoding
IsValidEncoding will tell you if the encoding is a valid key.
strkey.go:127
↓ 1 callers
Function
IsValidPublicAccountKey
IsValidPublicAccountKey will decode and verify the string is a valid encoded Public Account Key.
strkey.go:241
↓ 1 callers
Function
IsValidPublicClusterKey
IsValidPublicClusterKey will decode and verify the string is a valid encoded Public Cluster Key.
strkey.go:253
↓ 1 callers
Function
IsValidPublicCurveKey
IsValidPublicCurveKey will decode and verify the string is a valid encoded Public Curve Key.
strkey.go:265
↓ 1 callers
Function
IsValidPublicOperatorKey
IsValidPublicOperatorKey will decode and verify the string is a valid encoded Public Operator Key.
strkey.go:259
↓ 1 callers
Function
IsValidPublicServerKey
IsValidPublicServerKey will decode and verify the string is a valid encoded Public Server Key.
strkey.go:247
↓ 1 callers
Function
IsValidPublicUserKey
IsValidPublicUserKey will decode and verify the string is a valid encoded Public User Key.
strkey.go:235
↓ 1 callers
Function
ParseDecoratedUserNKey
ParseDecoratedUserNKey takes a creds file, finds the NKey portion and creates a key pair from it. Similar to ParseDecoratedNKey but fails for non-user
creds_utils.go:61
↓ 1 callers
Method
PrivateKey
PrivateKey will return the encoded private key for KeyPair.
keypair.go:98
↓ 1 callers
Method
PublicKey
PublicKey will return the encoded public key associated with the KeyPair. All KeyPairs have a public key.
keypair.go:81
↓ 1 callers
Method
SealWithRand
(input []byte, recipient string, rr io.Reader)
xkeys.go:132
↓ 1 callers
Method
Sign
Sign will sign the input with KeyPair's private key.
keypair.go:107
↓ 1 callers
Method
Verify
Verify will verify the input against a signature utilizing the public key.
public.go:54
↓ 1 callers
Function
createVanityKey
(keyType, vanity, entropy string, max int)
nk/main.go:256
↓ 1 callers
Function
printPublicFromSeed
(keyFile string)
nk/main.go:132
↓ 1 callers
Method
rawSeed
rawSeed will return the raw, decoded 64 byte seed.
keypair.go:54
↓ 1 callers
Function
sign
(fname, keyFile string)
nk/main.go:142
↓ 1 callers
Function
usage
()
nk/main.go:36
↓ 1 callers
Function
verify
(fname, keyFile, pubFile, sigFile string)
nk/main.go:164
↓ 1 callers
Function
wipeSlice
(buf []byte)
nk/main.go:329
Function
BenchmarkDecode
(b *testing.B)
strkey_test.go:22
Function
BenchmarkPublicVerify
(b *testing.B)
nkeys_test.go:662
Function
BenchmarkSign
(b *testing.B)
nkeys_test.go:620
Function
BenchmarkVerify
(b *testing.B)
nkeys_test.go:639
Method
Open
(input []byte, sender string)
xkeys.go:151
Method
Open
Open is only supported on CurveKey
keypair.go:138
Method
Open
(input []byte, sender string)
public.go:83
Method
PrivateKey
PrivateKey will return the encoded private key.
xkeys.go:87
Method
PrivateKey
PrivateKey will return an error since this is not available for public key only KeyPairs.
public.go:44
Method
PublicKey
PublicKey will return the encoded public key.
xkeys.go:79
Method
PublicKey
()
nkeys.go:27
Method
PublicKey
PublicKey will return the encoded public key associated with the KeyPair. All KeyPairs have a public key.
public.go:30
Method
Seal
Seal is compatible with nacl.Box.Seal() and can be used in similar situations for small messages. We generate the nonce from crypto rand by default.
xkeys.go:128
Method
Seal
Seal is only supported on CurveKeyPair
keypair.go:128
Method
Seal
(input []byte, recipient string)
public.go:70
Method
SealWithRand
SealWithRand is only supported on CurveKeyPair
keypair.go:133
Method
SealWithRand
(input []byte, _recipient string, rr io.Reader)
public.go:76
Method
Seed
Seed will return the encoded seed.
xkeys.go:74
Method
Seed
Seed will return the encoded seed.
keypair.go:75
Method
Seed
()
nkeys.go:26
Method
Seed
Seed will return an error since this is not available for public key only KeyPairs.
public.go:39
Method
Sign
(_ []byte)
xkeys.go:181
Method
Sign
Sign will return an error since this is not available for public key only KeyPairs.
public.go:49
Function
TestAccount
(t *testing.T)
nkeys_test.go:134
Function
TestBadDecode
(t *testing.T)
nkeys_test.go:500
Function
TestCluster
(t *testing.T)
nkeys_test.go:232
Function
TestCurveFromCreateCurveKeys
(t *testing.T)
xkeys_test.go:76
Function
TestCurveFromCreatePair
(t *testing.T)
xkeys_test.go:87
Function
TestCurveFromKeyPair
(t *testing.T)
xkeys_test.go:112
Function
TestCurveFromSeed
(t *testing.T)
xkeys_test.go:98
Function
TestCurvePublic
(t *testing.T)
xkeys_test.go:130
Function
TestCurvePublicEmptyBug
(t *testing.T)
xkeys_test.go:158
Function
TestDecode
(t *testing.T)
nkeys_test.go:72
next →
1–100 of 128, ranked by callers