Class JWSAlgorithmRegistry

java.lang.Object
se.swedenconnect.sigval.commons.algorithms.JWSAlgorithmRegistry

public class JWSAlgorithmRegistry extends Object
Registry for JWS signing algorithms
Author:
Martin Lindström (martin@idsec.se), Stefan Santesson (stefan@idsec.se)
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static com.nimbusds.jose.JWSAlgorithm
    get(String uri)
    Get the JWS algorithm for a signature algorithm URI identifier
    static String
    getUri(com.nimbusds.jose.JWSAlgorithm jwsAlgorithm)
    Get the URI identifier of the JWS algorithm
    static boolean
    register(String uri, com.nimbusds.jose.JWSAlgorithm algorithm)
    Register a new JWS signing algorithm

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • JWSAlgorithmRegistry

      public JWSAlgorithmRegistry()
  • Method Details

    • register

      public static boolean register(String uri, com.nimbusds.jose.JWSAlgorithm algorithm)
      Register a new JWS signing algorithm
      Parameters:
      uri - URI identifier for the signing algorithm
      algorithm - the new JWS algorithm
      Returns:
      true if the algorithm was added to the registry
    • getUri

      public static String getUri(com.nimbusds.jose.JWSAlgorithm jwsAlgorithm) throws NoSuchAlgorithmException
      Get the URI identifier of the JWS algorithm
      Parameters:
      jwsAlgorithm - JWS algorithm
      Returns:
      URI identifier
      Throws:
      NoSuchAlgorithmException - if the specified algorithm is not in the registry
    • get

      public static com.nimbusds.jose.JWSAlgorithm get(String uri) throws NoSuchAlgorithmException
      Get the JWS algorithm for a signature algorithm URI identifier
      Parameters:
      uri - URI identifier
      Returns:
      JWS algorithm
      Throws:
      NoSuchAlgorithmException - if the specified algorithm is not in the registry