# Are there any existing ASN.1 structures for transferring symmetric keys?

Is there any reasonable ASN.1 standard to encode symmetric keys?

I found PSKC, but it seems extremely heavy, and I can't quite find any library (e.g. bouncycastle) that would simplify using it.

If all I need is to encode a symmetric key, would it be sufficient to just include:

• algorithm ID
• block size
• key size
• key bits
• Depends on what you do with it really. A lot of times it is only required to encode the bytes if e.g. the algorithm is static, there is only one block size, and the encoding is such that it can be distinguished from other bytes in the data structure. Sep 24, 2015 at 20:31

For the algorithm you should use the AlgorithmIdentifier type of RFC5280. Block size and key size can be derived from the algorithm id and the key itself, so there is no need to store them.
SymmetricKey ::= SEQUENCE {