1
0
mirror of https://github.com/kataras/iris.git synced 2025-12-20 11:27:06 +00:00

add support for iris-specific form of generating connection IDs as requested at: https://github.com/kataras/neffos/issues/1#issuecomment-508689819

Former-commit-id: 0994b63373ebe2b5383a28f042aa2133061cbd18
This commit is contained in:
Gerasimos (Makis) Maropoulos
2019-07-05 16:22:20 +03:00
parent 9dbb300d9b
commit 2576b3da34
9 changed files with 65 additions and 39 deletions

View File

@@ -8,7 +8,8 @@ import (
)
var (
// Change that to your owns, usally you have an ECDSA private key
// Change that to your own key.
// Usually you have an ECDSA private key
// per identify, let's say a user, stored in a database
// or somewhere else and you use its public key
// to sign a user's payload and when this client
@@ -17,11 +18,9 @@ var (
// with the user's public key.
//
// Use the crypto.MustGenerateKey to generate a random key
// or import
// the "github.com/kataras/iris/crypto/sign"
// and use its
// sign.ParsePrivateKey/ParsePublicKey(theKey []byte)
// to convert data or local file to an *ecdsa.PrivateKey.
// or
// crypto.ParsePrivateKey to convert data or local file to an *ecdsa.PrivateKey.
// and `crypto.ParsePublicKey` if you only have access to the public one.
testPrivateKey = crypto.MustGenerateKey()
testPublicKey = &testPrivateKey.PublicKey
)
@@ -34,7 +33,7 @@ type testPayloadStructure struct {
// The Iris crypto package offers
// authentication (with optional encryption in top of) and verification
// of raw []byte data with `crypto.Marshal/Unmarshal` functions
// and JSON payloads with `crypto.SignJSON/VerifyJSON functions.
// and JSON payloads with `crypto.SignJSON/VerifyJSON` functions.
//
// Let's use the `SignJSON` and `VerifyJSON` here as an example,
// as this is the most common scenario for a web application.