proxygen
|
#include <AeadTicketCipher.h>
Public Member Functions | |
AeadTicketCipher (std::string pskContext) | |
AeadTicketCipher () | |
bool | setTicketSecrets (const std::vector< folly::ByteRange > &ticketSecrets) |
void | setContext (const FizzServerContext *context) |
void | setValidity (std::chrono::seconds validity) |
folly::Future< folly::Optional< std::pair< Buf, std::chrono::seconds > > > | encrypt (ResumptionState resState) const override |
folly::Future< std::pair< PskType, folly::Optional< ResumptionState > > > | decrypt (std::unique_ptr< folly::IOBuf > encryptedTicket) const override |
Public Member Functions inherited from fizz::server::TicketCipher | |
virtual | ~TicketCipher ()=default |
Private Attributes | |
AeadTokenCipher< AeadType, HkdfType > | tokenCipher_ |
std::chrono::seconds | validity_ {std::chrono::hours(1)} |
const FizzServerContext * | context_ = nullptr |
Definition at line 19 of file AeadTicketCipher.h.
|
inlineexplicit |
Set the PSK context used for these tickets. The PSK context is used as part of the key derivation so that different contexts will result in different keys, preventing keys from one context from being used for another.
Definition at line 27 of file AeadTicketCipher.h.
|
inline |
Definition at line 31 of file AeadTicketCipher.h.
|
inlineoverridevirtual |
Returns the ResumptionState for an opaque PSK, and the type of PSK (resumption or external).
Returns Rejected if the PSK is not recognized.
Implements fizz::server::TicketCipher.
Definition at line 62 of file AeadTicketCipher.h.
References fizz::server::AeadTicketCipher< AeadType, CodecType, HkdfType >::context_, fizz::decode(), folly::gen::move, folly::none, fizz::Rejected, fizz::Resumption, and fizz::server::AeadTicketCipher< AeadType, CodecType, HkdfType >::tokenCipher_.
|
inlineoverridevirtual |
Returns an opaque PSK for ResumptionState, and its validity time.
Implements fizz::server::TicketCipher.
Definition at line 51 of file AeadTicketCipher.h.
References encode(), folly::gen::move, folly::none, ticket, fizz::server::AeadTicketCipher< AeadType, CodecType, HkdfType >::tokenCipher_, and fizz::server::AeadTicketCipher< AeadType, CodecType, HkdfType >::validity_.
Referenced by fizz::server::test::AeadTicketCipherTest::checkUnsetEncrypt().
|
inline |
Definition at line 43 of file AeadTicketCipher.h.
References context, and fizz::server::AeadTicketCipher< AeadType, CodecType, HkdfType >::context_.
|
inline |
Set ticket secrets to use for ticket encryption/decryption. The first one will be used for encryption. All secrets must be at least kMinTicketSecretLength long.
Definition at line 39 of file AeadTicketCipher.h.
References fizz::server::AeadTicketCipher< AeadType, CodecType, HkdfType >::tokenCipher_.
Referenced by fizz::server::test::AeadTicketCipherTest::setTicketSecrets().
|
inline |
Definition at line 47 of file AeadTicketCipher.h.
References fizz::server::AeadTicketCipher< AeadType, CodecType, HkdfType >::validity_.
|
private |
Definition at line 82 of file AeadTicketCipher.h.
Referenced by fizz::server::AeadTicketCipher< AeadType, CodecType, HkdfType >::decrypt(), and fizz::server::AeadTicketCipher< AeadType, CodecType, HkdfType >::setContext().
|
private |
Definition at line 78 of file AeadTicketCipher.h.
Referenced by fizz::server::AeadTicketCipher< AeadType, CodecType, HkdfType >::decrypt(), fizz::server::AeadTicketCipher< AeadType, CodecType, HkdfType >::encrypt(), and fizz::server::AeadTicketCipher< AeadType, CodecType, HkdfType >::setTicketSecrets().
|
private |
Definition at line 80 of file AeadTicketCipher.h.
Referenced by fizz::server::AeadTicketCipher< AeadType, CodecType, HkdfType >::encrypt(), and fizz::server::AeadTicketCipher< AeadType, CodecType, HkdfType >::setValidity().