auth/vendor/github.com/lestrrat-go/jwx/v2/jwe/options.yaml

123 lines
4.5 KiB
YAML

package_name: jwe
output: jwe/options_gen.go
interfaces:
- name: CompactOption
comment: |
CompactOption describes options that can be passed to `jwe.Compact`
- name: DecryptOption
comment: |
DecryptOption describes options that can be passed to `jwe.Decrypt`
- name: EncryptOption
comment: |
EncryptOption describes options that can be passed to `jwe.Encrypt`
- name: EncryptDecryptOption
methods:
- encryptOption
- decryptOption
comment: |
EncryptDecryptOption describes options that can be passed to either `jwe.Encrypt` or `jwe.Decrypt`
- name: WithJSONSuboption
concrete_type: withJSONSuboption
comment: |
JSONSuboption describes suboptions that can be passed to `jwe.WithJSON()` option
- name: WithKeySetSuboption
comment: |
WithKeySetSuboption is a suboption passed to the WithKeySet() option
- name: ParseOption
methods:
- readFileOption
comment: |
ReadFileOption is a type of `Option` that can be passed to `jwe.Parse`
- name: ReadFileOption
comment: |
ReadFileOption is a type of `Option` that can be passed to `jwe.ReadFile`
options:
- ident: Key
skip_option: true
- ident: Pretty
skip_option: true
- ident: ProtectedHeaders
skip_option: true
- ident: PerRecipientHeaders
skip_option: true
- ident: KeyProvider
interface: DecryptOption
argument_type: KeyProvider
- ident: Serialization
option_name: WithCompact
interface: EncryptOption
constant_value: fmtCompact
comment: |
WithCompact specifies that the result of `jwe.Encrypt()` is serialized in
compact format.
By default `jwe.Encrypt()` will opt to use compact format, so you usually
do not need to specify this option other than to be explicit about it
- ident: Compress
interface: EncryptOption
argument_type: jwa.CompressionAlgorithm
comment: |
WithCompress specifies the compression algorithm to use when encrypting
a payload using `jwe.Encrypt` (Yes, we know it can only be "" or "DEF",
but the way the specification is written it could allow for more options,
and therefore this option takes an argument)
- ident: ContentEncryptionAlgorithm
interface: EncryptOption
option_name: WithContentEncryption
argument_type: jwa.ContentEncryptionAlgorithm
comment: |
WithContentEncryptionAlgorithm specifies the algorithm to encrypt the
JWE message content with. If not provided, `jwa.A256GCM` is used.
- ident: Message
interface: DecryptOption
argument_type: '*Message'
comment: |
WithMessage provides a message object to be populated by `jwe.Decrpt`
Using this option allows you to decrypt AND obtain the `jwe.Message`
in one go.
Note that you should NOT be using the message object for anything other
than inspecting its contents. Particularly, do not expect the message
reliable when you call `Decrypt` on it. `(jwe.Message).Decrypt` is
slated to be deprecated in the next major version.
- ident: RequireKid
interface: WithKeySetSuboption
argument_type: bool
comment: |
WithrequiredKid specifies whether the keys in the jwk.Set should
only be matched if the target JWE message's Key ID and the Key ID
in the given key matches.
- ident: Pretty
interface: WithJSONSuboption
argument_type: bool
comment: |
WithPretty specifies whether the JSON output should be formatted and
indented
- ident: MergeProtectedHeaders
interface: EncryptOption
argument_type: bool
comment: |
WithMergeProtectedHeaders specify that when given multiple headers
as options to `jwe.Encrypt`, these headers should be merged instead
of overwritten
- ident: FS
interface: ReadFileOption
argument_type: fs.FS
comment: |
WithFS specifies the source `fs.FS` object to read the file from.
- ident: KeyUsed
interface: DecryptOption
argument_type: 'interface{}'
comment: |
WithKeyUsed allows you to specify the `jwe.Decrypt()` function to
return the key used for decryption. This may be useful when
you specify multiple key sources or if you pass a `jwk.Set`
and you want to know which key was successful at decrypting the
signature.
`v` must be a pointer to an empty `interface{}`. Do not use
`jwk.Key` here unless you are 100% sure that all keys that you
have provided are instances of `jwk.Key` (remember that the
jwx API allows users to specify a raw key such as *rsa.PublicKey)