java_src/src/main/java/com/google/crypto/tink/jwt/RawJwt.java
/**
     * Adds an audience that the JWT is intended for.
     *
     * <p>https://tools.ietf.org/html/rfc7519#section-4.1.3
     */
Adds an audience that the JWT is intended for.
Adds an audience that the JWT is intended for .
public Builder addAudience(String value) {
      if (!JsonUtil.isValidString(value)) {
        throw new IllegalArgumentException();
      }
      JsonArray audiences = new JsonArray();
      if (payload.has(JwtNames.CLAIM_AUDIENCE)) {
        audiences = payload.get(JwtNames.CLAIM_AUDIENCE).getAsJsonArray();
      }
      audiences.add(value);
      payload.add(JwtNames.CLAIM_AUDIENCE, audiences);
      return this;
    }
public Builder addAudience ( String value ) { if ( ! JsonUtil . isValidString ( value ) ) { throw new IllegalArgumentException ( ) ; } JsonArray audiences = new JsonArray ( ) ; if ( payload . has ( JwtNames . CLAIM_AUDIENCE ) ) { audiences = payload . get ( JwtNames . CLAIM_AUDIENCE ) . getAsJsonArray ( ) ; } audiences . add ( value ) ; payload . add ( JwtNames . CLAIM_AUDIENCE , audiences ) ; return this ; }
Adds an audience that the JWT is intended for.
Adds an audience that the JWT is intended for .