Creating a EncryptedKey for SubjectConfirmation

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Creating a EncryptedKey for SubjectConfirmation

Stefan Rasmusson
Im trying to encrypt a key to be used in a holder of key subject confirmation. This EncryptedKey will be contained in a key info element inside the subject confirmation data. All my research only turns up how to create a keyinfo with encrypted key when encrypting another element.

Any ideas on how this could be done?

--
Stefan

--
To unsubscribe from this list send an email to [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: Creating a EncryptedKey for SubjectConfirmation

Brent Putman


On 6/20/19 8:00 PM, Stefan Rasmusson wrote:
Im trying to encrypt a key to be used in a holder of key subject confirmation. This EncryptedKey will be contained in a key info element inside the subject confirmation data. All my research only turns up how to create a keyinfo with encrypted key when encrypting another element.

Any ideas on how this could be done?


org.opensaml.xmlsec.encryption.support.Encrypter contains a couple of public encryptKey(java.security.Key, ...) methods, which support encrypting any Java Key to an OpenSAML EncryptedKey.  Then you would just build a KeyInfo as usual with its builder and add the EncryptedKey via the KeyInfo#getEncrypedKeys().


--
To unsubscribe from this list send an email to [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: Creating a EncryptedKey for SubjectConfirmation

Stefan Rasmusson
Thank you Brent! I just a few hours ago figured it out myself 😀 I hope I didn't waste to much of your time. 

On Sat, Jun 22, 2019, 22:19 Brent Putman <[hidden email]> wrote:


On 6/20/19 8:00 PM, Stefan Rasmusson wrote:
Im trying to encrypt a key to be used in a holder of key subject confirmation. This EncryptedKey will be contained in a key info element inside the subject confirmation data. All my research only turns up how to create a keyinfo with encrypted key when encrypting another element.

Any ideas on how this could be done?


org.opensaml.xmlsec.encryption.support.Encrypter contains a couple of public encryptKey(java.security.Key, ...) methods, which support encrypting any Java Key to an OpenSAML EncryptedKey.  Then you would just build a KeyInfo as usual with its builder and add the EncryptedKey via the KeyInfo#getEncrypedKeys().

--
To unsubscribe from this list send an email to [hidden email]

--
To unsubscribe from this list send an email to [hidden email]