Ecosyste.ms: Packages

An open API service providing package, version and dependency metadata of many open source software ecosystems and registries.

Top 3.0% on proxy.golang.org
Top 2.5% dependent packages on proxy.golang.org
Top 4.7% dependent repos on proxy.golang.org
Top 2.3% forks on proxy.golang.org

proxy.golang.org : gopkg.in/gorilla/securecookie.v1

Package securecookie encodes and decodes authenticated and optionally encrypted cookie values. Secure cookies can't be forged, because their values are validated using HMAC. When encrypted, the content is also inaccessible to malicious eyes. To use it, first create a new SecureCookie instance: The hashKey is required, used to authenticate the cookie value using HMAC. It is recommended to use a key with 32 or 64 bytes. The blockKey is optional, used to encrypt the cookie value -- set it to nil to not use encryption. If set, the length must correspond to the block size of the encryption algorithm. For AES, used by default, valid lengths are 16, 24, or 32 bytes to select AES-128, AES-192, or AES-256. Strong keys can be created using the convenience function GenerateRandomKey(). Once a SecureCookie instance is set, use it to encode a cookie value: Later, use the same SecureCookie instance to decode and validate a cookie value: We stored a map[string]string, but secure cookies can hold any value that can be encoded using encoding/gob. To store custom types, they must be registered first using gob.Register(). For basic types this is not needed; it works out of the box.

Registry - Source - Documentation - JSON
purl: pkg:golang/gopkg.in/gorilla/securecookie.v1
Keywords: cookie, go, securecookie
License: BSD-3-Clause
Latest release: over 7 years ago
First release: over 7 years ago
Namespace: gopkg.in/gorilla
Dependent packages: 5
Dependent repositories: 1
Stars: 610 on GitHub
Forks: 148 on GitHub
See more repository details: repos.ecosyste.ms
Last synced: 24 days ago

    Loading...
    Readme
    Loading...