Examples xml.CryptoKey usage examples. Loading an asymmetric RSA key Generating a symmetric AES256 key Setting a HMAC key Deriving a HMAC key Computing the shared secret with Diffie-Hellman Load the Diffie-Hellman parameters from a PEM file, the other peer's public key from an XML file, and compute the shared secret.