(sharedSecret string)
| 43 | } |
| 44 | |
| 45 | func NewSharedSecretRegistration(sharedSecret string) *SharedSecretRegistration { |
| 46 | return &SharedSecretRegistration{ |
| 47 | sharedSecret: sharedSecret, |
| 48 | // nonces live for 5mins, purge every 10mins |
| 49 | nonces: cache.New(5*time.Minute, 10*time.Minute), |
| 50 | } |
| 51 | } |
| 52 | |
| 53 | func (r *SharedSecretRegistration) GenerateNonce() string { |
| 54 | nonce := util.RandomString(16) |
no outgoing calls