aboutsummaryrefslogtreecommitdiffstats
path: root/documentation/components/components-fields.asciidoc
Commit message (Expand)AuthorAgeFilesLines
* Add an optional HasValue to a ValueContextIlia Motornyi2017-06-291-1/+5
* Update example to Vaadin 8 (#9260)dunand2017-05-081-7/+5
* Documentation: fix wrong method namedunand2017-05-041-1/+1
* New documentation diagrams (#8156)Ilia Motornyi2017-01-091-4/+2
* Update general Component documentationPekka Hyvönen2017-01-041-63/+43
* Fix documentation for /components (#8051)Pekka Hyvönen2016-12-191-9/+5
* Update documentation to match API in vol2Artur Signell2016-08-051-11/+11
* Re-enable accidentally disabled fields documentationArtur Signell2016-08-051-8/+0
* BoV: Components/Fields: Data binding and validation using BinderJohannes Dahlström2016-08-051-222/+104
* Revised client-side arch, Java Servlet, new project, view navigation, and bas...Marko Gronroos2016-08-051-3/+11
* Vaadin 8 terminology changes: Field ComponentsJohannes Dahlström2016-08-051-14/+12
* Revised diagrams in intro, installation, architecture, and application chapte...Marko Gronroos2016-08-051-5/+8
* Scaled images for print edition and fixed errors up to the beginning of layou...Marko Gronroos2016-06-301-38/+32
* Add documentation to master branchMarkus Koivisto2016-01-221-0/+345
* Revert "Merge branch 'documentation'"7.6.0.beta2Ilia Motornyi2015-12-031-345/+0
* Framework documentation INelmot2015-09-251-0/+345
s="w"> // HS384 SigningMethodHS384 = &SigningMethodHMAC{"HS384", crypto.SHA384} RegisterSigningMethod(SigningMethodHS384.Alg(), func() SigningMethod { return SigningMethodHS384 }) // HS512 SigningMethodHS512 = &SigningMethodHMAC{"HS512", crypto.SHA512} RegisterSigningMethod(SigningMethodHS512.Alg(), func() SigningMethod { return SigningMethodHS512 }) } func (m *SigningMethodHMAC) Alg() string { return m.Name } // Verify the signature of HSXXX tokens. Returns nil if the signature is valid. func (m *SigningMethodHMAC) Verify(signingString, signature string, key interface{}) error { // Verify the key is the right type keyBytes, ok := key.([]byte) if !ok { return ErrInvalidKeyType } // Decode signature, for comparison sig, err := DecodeSegment(signature) if err != nil { return err } // Can we use the specified hashing method? if !m.Hash.Available() { return ErrHashUnavailable } // This signing method is symmetric, so we validate the signature // by reproducing the signature from the signing string and key, then // comparing that against the provided signature. hasher := hmac.New(m.Hash.New, keyBytes) hasher.Write([]byte(signingString)) if !hmac.Equal(sig, hasher.Sum(nil)) { return ErrSignatureInvalid } // No validation errors. Signature is good. return nil } // Implements the Sign method from SigningMethod for this signing method. // Key must be []byte func (m *SigningMethodHMAC) Sign(signingString string, key interface{}) (string, error) { if keyBytes, ok := key.([]byte); ok { if !m.Hash.Available() { return "", ErrHashUnavailable } hasher := hmac.New(m.Hash.New, keyBytes) hasher.Write([]byte(signingString)) return EncodeSegment(hasher.Sum(nil)), nil } return "", ErrInvalidKeyType }