schema-include av.tcl
schema-include fpr.tcl

signed {
    {field . {map}}
    {field tbs {with tbs}}
    {# field data is optional, arbitrary type}
    {field pubs {list} {of type map} >0 optional}
    {field sigs {list} {of sig} >0 optional}
}

tbs {
    {field . {map}}
    {field t {str} >0} {# type of the data we sign}
}

sig {
    {field . {map}}
    {field tbs {with sig-tbs}}
    {field sign {with av}}
}

sig-tbs {
    {field . {map}}
    {field sid {with fpr}}
    {field nonce {bin} >0 optional} {# random bytes}
    {field when {tai} utc prec=ms optional}

    {# recipient's fingerprints}
    {field encrypted-to {list} {of fpr} >0 optional}
}
