You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am attempting to sign using RSA/PS512 and am getting this error when running the build() function.
[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: Bad state: This JsonWebKey does not support the 'sign' operation.
#0 JsonWebKey._assertCanDo (package:jose/src/jwk.dart:410:7)
jwk.dart:410 #1 JsonWebKey.sign (package:jose/src/jwk.dart:271:5)
jwk.dart:271 #2 new _JwsRecipient._sign (package:jose/src/jws.dart:159:16)
jws.dart:159 #3 JsonWebSignatureBuilder.build. (package:jose/src/jws.dart:193:28)
jws.dart:193 #4 MappedListIterable.elementAt (dart:_internal/iterable.dart:425:31)
iterable.dart:425 #5 ListIterator.moveNext (dart:_internal/iterable.dart:354:26)
iterable.dart:354 #6 new _GrowableList._ofEfficientLengthIterable (dart:core-patch/growable_array.dart:189:27)
growable_array.dart:189 #7 new _GrowableList.of (dart:core-patch/growable_array.dart:150:28)
growable_array.dart:150 #8 new List.of (dart:core-patch/array_patch.dart:39:18)
array_patch.dart:39 #9 ListIterable.toList (dart:_internal/iterable.dart:224:7)
iterable.dart:224 #10 JsonWebSignatureBuilder.build (package:jose/src/jws.dart:195:8)
Example code below
// create a builder, decoding the JWT in a JWS, so using a
// JsonWebSignatureBuilder
var builder = new Jose.JsonWebSignatureBuilder();
// set the content
builder.jsonContent = claims.toJson();
// add a key to sign, can only add one for JWT
builder.addRecipient(
new Jose.JsonWebKey.fromJson(
{"kty": "RSA", 'k":privateKey}),
algorithm: "PS512");
// build the jws
var jws = builder.build();
The text was updated successfully, but these errors were encountered:
I am attempting to sign using RSA/PS512 and am getting this error when running the build() function.
Example code below
The text was updated successfully, but these errors were encountered: