Method: JOSE::JWE.peek_tag

Defined in:
lib/jose/jwe.rb

.peek_tag(encrypted) ⇒ String

Returns the decoded tag portion of a encrypted binary or map without decrypting the ciphertext.

JOSE::JWE.peek_tag("eyJhbGciOiJBMTI4S1ciLCJlbmMiOiJBMTI4R0NNIn0.t4_Fb4kCl6BcS1cXnR4P4Xgm-jwVNsFl.RerKfWjzqqtLIUrz.JmE.ZDpVlWo-aQYM5la9eshwWw")
# => "d:U\x95j>i\x06\f\xE6V\xBDz\xC8p["

Parameters:

Returns:

  • (String)


1037
1038
1039
1040
1041
1042
# File 'lib/jose/jwe.rb', line 1037

def self.peek_tag(encrypted)
  if encrypted.is_a?(String)
    encrypted = expand(encrypted)
  end
  return JOSE.urlsafe_decode64(encrypted['tag'])
end