Documentation ¶
Index ¶
- Variables
- func UnmarshalToken(data []byte) (tokens.Token, error)
- type ClientState
- type ClientStateCache
- type EncapKey
- type InnerTokenRequest
- type PrivateEncapKey
- type RateLimitedAttester
- type RateLimitedClient
- type RateLimitedIssuer
- func (i *RateLimitedIssuer) AddOrigin(origin string) error
- func (i *RateLimitedIssuer) AddOriginWithIndexKey(origin string, privateKey *ecdsa.PrivateKey) error
- func (i RateLimitedIssuer) Evaluate(encodedRequest []byte) ([]byte, []byte, error)
- func (i *RateLimitedIssuer) NameKey() EncapKey
- func (i *RateLimitedIssuer) OriginIndexKey(origin string) *ecdsa.PrivateKey
- func (i *RateLimitedIssuer) TokenKey() *rsa.PublicKey
- func (i *RateLimitedIssuer) TokenKeyID() []byte
- func (i RateLimitedIssuer) Type() uint16
- type RateLimitedTokenRequest
- type RateLimitedTokenRequestState
Constants ¶
This section is empty.
Variables ¶
View Source
var (
RateLimitedTokenType = uint16(0x0003)
)
Functions ¶
Types ¶
type ClientState ¶
type ClientState struct {
// contains filtered or unexported fields
}
type ClientStateCache ¶
type ClientStateCache interface { Get(clientID string) (*ClientState, bool) Put(clientID string, state *ClientState) }
type EncapKey ¶
type EncapKey struct {
// contains filtered or unexported fields
}
func UnmarshalEncapKey ¶
func (EncapKey) Marshal ¶
opaque HpkePublicKey[Npk]; // defined in I-D.irtf-cfrg-hpke uint16 HpkeKemId; // defined in I-D.irtf-cfrg-hpke uint16 HpkeKdfId; // defined in I-D.irtf-cfrg-hpke uint16 HpkeAeadId; // defined in I-D.irtf-cfrg-hpke
struct { uint8 key_id; HpkeKemId kem_id; HpkePublicKey public_key; HpkeKdfId kdf_id; HpkeAeadId aead_id; } EncapKey;
type InnerTokenRequest ¶
type InnerTokenRequest struct {
// contains filtered or unexported fields
}
func (*InnerTokenRequest) Marshal ¶
func (r *InnerTokenRequest) Marshal() []byte
func (*InnerTokenRequest) Unmarshal ¶
func (r *InnerTokenRequest) Unmarshal(data []byte) bool
type PrivateEncapKey ¶
type PrivateEncapKey struct {
// contains filtered or unexported fields
}
https://tfpauly.github.io/privacy-proxy/draft-privacypass-rate-limit-tokens.html#name-configuration
func CreatePrivateEncapKeyFromSeed ¶
func CreatePrivateEncapKeyFromSeed(seed []byte) (PrivateEncapKey, error)
func (PrivateEncapKey) IsEqual ¶
func (k PrivateEncapKey) IsEqual(o PrivateEncapKey) bool
func (PrivateEncapKey) Public ¶
func (k PrivateEncapKey) Public() EncapKey
type RateLimitedAttester ¶
type RateLimitedAttester struct {
// contains filtered or unexported fields
}
func NewRateLimitedAttester ¶
func NewRateLimitedAttester(cache ClientStateCache) *RateLimitedAttester
func (*RateLimitedAttester) FinalizeIndex ¶
func (a *RateLimitedAttester) FinalizeIndex(clientKey, blindEnc, blindedRequestKeyEnc, anonOriginId []byte) ([]byte, error)
func (*RateLimitedAttester) VerifyRequest ¶
func (a *RateLimitedAttester) VerifyRequest(tokenRequest RateLimitedTokenRequest, blindKeyEnc, clientKeyEnc, anonymousOrigin []byte) error
type RateLimitedClient ¶
type RateLimitedClient struct {
// contains filtered or unexported fields
}
func NewRateLimitedClientFromSecret ¶
func NewRateLimitedClientFromSecret(secret []byte) RateLimitedClient
func (RateLimitedClient) CreateTokenRequest ¶
func (c RateLimitedClient) CreateTokenRequest(challenge, nonce, blindKeyEnc []byte, tokenKeyID []byte, tokenKey *rsa.PublicKey, originName string, nameKey EncapKey) (RateLimitedTokenRequestState, error)
type RateLimitedIssuer ¶
type RateLimitedIssuer struct {
// contains filtered or unexported fields
}
func NewRateLimitedIssuer ¶
func NewRateLimitedIssuer(key *rsa.PrivateKey) *RateLimitedIssuer
func (*RateLimitedIssuer) AddOrigin ¶
func (i *RateLimitedIssuer) AddOrigin(origin string) error
func (*RateLimitedIssuer) AddOriginWithIndexKey ¶
func (i *RateLimitedIssuer) AddOriginWithIndexKey(origin string, privateKey *ecdsa.PrivateKey) error
func (RateLimitedIssuer) Evaluate ¶
func (i RateLimitedIssuer) Evaluate(encodedRequest []byte) ([]byte, []byte, error)
func (*RateLimitedIssuer) NameKey ¶
func (i *RateLimitedIssuer) NameKey() EncapKey
func (*RateLimitedIssuer) OriginIndexKey ¶
func (i *RateLimitedIssuer) OriginIndexKey(origin string) *ecdsa.PrivateKey
func (*RateLimitedIssuer) TokenKey ¶
func (i *RateLimitedIssuer) TokenKey() *rsa.PublicKey
func (*RateLimitedIssuer) TokenKeyID ¶
func (i *RateLimitedIssuer) TokenKeyID() []byte
func (RateLimitedIssuer) Type ¶
func (i RateLimitedIssuer) Type() uint16
type RateLimitedTokenRequest ¶
type RateLimitedTokenRequest struct { RequestKey []byte // Npk bytes NameKeyID []byte // 32 bytes EncryptedTokenRequest []byte // 16-bit length prefixed slice Signature []byte // Nsig bytes // contains filtered or unexported fields }
https://tfpauly.github.io/privacy-proxy/draft-privacypass-rate-limit-tokens.html#section-5.3
func (RateLimitedTokenRequest) Equal ¶
func (r RateLimitedTokenRequest) Equal(r2 RateLimitedTokenRequest) bool
func (*RateLimitedTokenRequest) Marshal ¶
func (r *RateLimitedTokenRequest) Marshal() []byte
func (*RateLimitedTokenRequest) Type ¶
func (r *RateLimitedTokenRequest) Type() uint16
func (*RateLimitedTokenRequest) Unmarshal ¶
func (r *RateLimitedTokenRequest) Unmarshal(data []byte) bool
type RateLimitedTokenRequestState ¶
type RateLimitedTokenRequestState struct {
// contains filtered or unexported fields
}
func (RateLimitedTokenRequestState) ClientKey ¶
func (s RateLimitedTokenRequestState) ClientKey() []byte
func (RateLimitedTokenRequestState) FinalizeToken ¶
func (s RateLimitedTokenRequestState) FinalizeToken(encryptedtokenResponse []byte) (tokens.Token, error)
func (RateLimitedTokenRequestState) Request ¶
func (s RateLimitedTokenRequestState) Request() *RateLimitedTokenRequest
func (RateLimitedTokenRequestState) RequestKey ¶
func (s RateLimitedTokenRequestState) RequestKey() []byte
Click to show internal directories.
Click to hide internal directories.