mirror of
https://github.com/kataras/iris.git
synced 2026-01-08 12:31:58 +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:
@@ -9,9 +9,13 @@ import (
|
||||
)
|
||||
|
||||
var (
|
||||
// MustGenerateKey generates an ecdsa public and private key pair.
|
||||
// MustGenerateKey generates an ecdsa private and public key pair.
|
||||
// It panics if any error occurred.
|
||||
MustGenerateKey = sign.MustGenerateKey
|
||||
// ParsePrivateKey accepts a pem x509-encoded private key and decodes to *ecdsa.PrivateKey.
|
||||
ParsePrivateKey = sign.ParsePrivateKey
|
||||
// ParsePublicKey accepts a pem x509-encoded public key and decodes to *ecdsa.PrivateKey.
|
||||
ParsePublicKey = sign.ParsePublicKey
|
||||
|
||||
// MustGenerateAESKey generates an aes key.
|
||||
// It panics if any error occurred.
|
||||
@@ -79,9 +83,9 @@ func Decrypt(aesKey, additionalData []byte) Decryption {
|
||||
// Returns non-nil error if any error occurred.
|
||||
//
|
||||
// Usage:
|
||||
// data, _ := ioutil.ReadAll(r.Body)
|
||||
// data, _ := ioutil.ReadAll(ctx.Request().Body)
|
||||
// signedData, err := crypto.Marshal(testPrivateKey, data, nil)
|
||||
// w.Write(signedData)
|
||||
// ctx.Write(signedData)
|
||||
// Or if data should be encrypted:
|
||||
// signedEncryptedData, err := crypto.Marshal(testPrivateKey, data, crypto.Encrypt(aesKey, nil))
|
||||
func Marshal(privateKey *ecdsa.PrivateKey, data []byte, encrypt Encryption) ([]byte, error) {
|
||||
|
||||
Reference in New Issue
Block a user