static function wrapPublicKey($key, $algorithm)
{
$asn1 = new ASN1();
$key = ['publicKeyAlgorithm' => ['algorithm' => $algorithm, 'parameters' => null], 'publicKey' => Base64::encode("" . $key)];
$key = $asn1->encodeDER($key, PublicKeyInfo);
return "-----BEGIN PUBLIC KEY-----\r\n" . chunk_split(Base64::encode($key), 64) . "-----END PUBLIC KEY-----";
}