wrapKey method
Encrypt key
Implementation
List<int> wrapKey(JsonWebKey key, {String? algorithm}) {
_assertCanDo('wrapKey');
if (key.keyType != 'oct') {
throw UnsupportedError('Can only wrap symmetric keys');
}
algorithm ??= this.algorithm;
var encrypter =
_keyPair.publicKey!.createEncrypter(_getAlgorithm(algorithm));
var v = encrypter.encrypt(decodeBase64EncodedBytes(key['k']) as Uint8List);
return v.data;
}