[strongSwan] API to access keys used by IPsec
martin at strongswan.org
Wed Jun 22 09:11:18 CEST 2011
> I have an encryption protocol that currently use pre-shared keys. I
> would like to use charon from strongSwan to do the key exchange.
> What's the API to access those keys used by IPsec? Also are those
> keys in memory or in files? If in files, where are they?
It's not really clear to me what you want to do. The IKEv2 protocol can
use pre-shared keys to authenticate the peers. These keys are usually
stored in the ipsec.secrets file, but other credential backends
implementing the credential_set_t  interface can be used to query
The actually used encryption keys are derived from a Diffie-Hellman
exchange and other parameters. To intercept these keys programmatically,
you could implement the ike_keys()/child_keys() hooks  in your own
More information about the Users