Package org.oa4mp.server.loader.qdl.util
Class SigningCommands
- java.lang.Object
-
- edu.uiuc.ncsa.security.util.cli.AbstractCommandsImpl
-
- edu.uiuc.ncsa.security.util.cli.CommonCommands2
-
- org.oa4mp.server.loader.qdl.util.SigningCommands
-
- All Implemented Interfaces:
edu.uiuc.ncsa.security.core.Logable
,edu.uiuc.ncsa.security.util.cli.Commands
,Serializable
public class SigningCommands extends edu.uiuc.ncsa.security.util.cli.CommonCommands2
Created by Jeff Gaynor
on 1/6/17 at 9:27 AM- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description int
defaultSymmetricKeyLength
protected static edu.uiuc.ncsa.security.util.jwk.JWKUtil2
jwkUtil2
static String
RS_256
static String
RS_384
static String
RS_512
String
SYMMETRIC_KEY_ARG
String
SYMMETRIC_KEY_COUNT_ARG
String
SYMMETRIC_KEY_FILE_ARG
-
Constructor Summary
Constructors Constructor Description SigningCommands(edu.uiuc.ncsa.security.util.cli.CLIDriver driver, OA2SE oa2se)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
about(boolean showBanner, boolean showHeader)
void
create(edu.uiuc.ncsa.security.util.cli.InputLine inputLine)
void
create_symmetric_keys(edu.uiuc.ncsa.security.util.cli.InputLine inputLine)
static edu.uiuc.ncsa.security.util.jwk.JSONWebKeys
createECJsonWebKeys(String defaultKeyID)
Note that these are done as perhttps://www.rfc-editor.org/rfc/rfc7518.html#section-3.4 and generate the basic set of all elliptic curvesstatic edu.uiuc.ncsa.security.util.jwk.JSONWebKeys
createECJsonWebKeys(String curve, String defaultKeyID)
Create a set of keys for a given curve using the 3 standard signing algorithms.static edu.uiuc.ncsa.security.util.jwk.JSONWebKey
createECJWK(String curve, String algorithm)
protected void
createHelp()
static edu.uiuc.ncsa.security.util.jwk.JSONWebKeys
createJsonWebKeys()
static edu.uiuc.ncsa.security.util.jwk.JSONWebKey
createJWK(String algorithm)
static edu.uiuc.ncsa.security.util.jwk.JSONWebKey
createJWK(String algorithm, boolean isRSA)
static edu.uiuc.ncsa.security.util.jwk.JSONWebKeys
createRSAJsonWebKeys(int size, String defaultKeyID)
These are done as per https://www.rfc-editor.org/rfc/rfc7518.html#section-3.3static edu.uiuc.ncsa.security.util.jwk.JSONWebKey
createRSAJWK(int size, String algorithm)
static edu.uiuc.ncsa.security.util.jwk.JWKUtil2
getJwkUtil2()
String
getName()
OA2SE
getOa2SE()
String
getPrompt()
void
initialize()
void
load(edu.uiuc.ncsa.security.util.cli.InputLine inputLine)
static void
setJwkUtil2(edu.uiuc.ncsa.security.util.jwk.JWKUtil2 newJWKUtil2)
protected void
showSymmetricKeyHelp()
-
Methods inherited from class edu.uiuc.ncsa.security.util.cli.CommonCommands2
getIOInterface, getPlaceHolder, getValue, isEmpty, isThrowExceptions, isVerbose, print_help, say2, sayii, set_output_on, set_verbose_on, setOutputOnHelp, setPlaceHolder, setThrowExceptions, setVerboseHelp, version, versionHelp
-
Methods inherited from class edu.uiuc.ncsa.security.util.cli.AbstractCommandsImpl
bootstrap, bootstrap, clear_env, clearEnvHelp, debug, error, error, get_env, getDriver, getHelpUtil, getInput, getLogoName, getPropertyHelp, gracefulExit, hasLogger, indentWidth, info, initHelp, isDebugOn, isOk, isShowHeader, isShowLogo, print_env, printEnvHelp, printGetEnvHelp, printReadEnvHelp, printSaveEnvHelp, printSetEnvHelp, read_env, readJSON, readline, readline, save_env, say, say, sayi, sayv, set_env, setDebugOn, setDriver, setLogoName, setShowHeader, setShowLogo, showHelp, warn
-
-
-
-
Field Detail
-
RS_256
public static final String RS_256
- See Also:
- Constant Field Values
-
RS_384
public static final String RS_384
- See Also:
- Constant Field Values
-
RS_512
public static final String RS_512
- See Also:
- Constant Field Values
-
defaultSymmetricKeyLength
public int defaultSymmetricKeyLength
-
SYMMETRIC_KEY_ARG
public String SYMMETRIC_KEY_ARG
-
SYMMETRIC_KEY_COUNT_ARG
public String SYMMETRIC_KEY_COUNT_ARG
-
SYMMETRIC_KEY_FILE_ARG
public String SYMMETRIC_KEY_FILE_ARG
-
jwkUtil2
protected static edu.uiuc.ncsa.security.util.jwk.JWKUtil2 jwkUtil2
-
-
Method Detail
-
about
public void about(boolean showBanner, boolean showHeader)
- Specified by:
about
in classedu.uiuc.ncsa.security.util.cli.AbstractCommandsImpl
-
initialize
public void initialize() throws Throwable
- Specified by:
initialize
in classedu.uiuc.ncsa.security.util.cli.AbstractCommandsImpl
- Throws:
Throwable
-
load
public void load(edu.uiuc.ncsa.security.util.cli.InputLine inputLine) throws Throwable
- Specified by:
load
in classedu.uiuc.ncsa.security.util.cli.AbstractCommandsImpl
- Throws:
Throwable
-
getOa2SE
public OA2SE getOa2SE()
-
getName
public String getName()
-
getPrompt
public String getPrompt()
-
createHelp
protected void createHelp()
-
create
public void create(edu.uiuc.ncsa.security.util.cli.InputLine inputLine) throws Exception
- Throws:
Exception
-
createRSAJsonWebKeys
public static edu.uiuc.ncsa.security.util.jwk.JSONWebKeys createRSAJsonWebKeys(int size, String defaultKeyID) throws NoSuchAlgorithmException, InvalidAlgorithmParameterException
These are done as per https://www.rfc-editor.org/rfc/rfc7518.html#section-3.3
-
createECJsonWebKeys
public static edu.uiuc.ncsa.security.util.jwk.JSONWebKeys createECJsonWebKeys(String defaultKeyID) throws NoSuchAlgorithmException, InvalidAlgorithmParameterException
Note that these are done as perhttps://www.rfc-editor.org/rfc/rfc7518.html#section-3.4 and generate the basic set of all elliptic curves- Returns:
- Throws:
NoSuchAlgorithmException
InvalidAlgorithmParameterException
-
createECJsonWebKeys
public static edu.uiuc.ncsa.security.util.jwk.JSONWebKeys createECJsonWebKeys(String curve, String defaultKeyID) throws NoSuchAlgorithmException, InvalidAlgorithmParameterException
Create a set of keys for a given curve using the 3 standard signing algorithms. If the parameter is trivial, then it returns the default as per#createECJsonWebKeys()
;- Parameters:
curve
-- Returns:
- Throws:
NoSuchAlgorithmException
InvalidAlgorithmParameterException
-
createJsonWebKeys
public static edu.uiuc.ncsa.security.util.jwk.JSONWebKeys createJsonWebKeys() throws NoSuchAlgorithmException, InvalidAlgorithmParameterException
-
showSymmetricKeyHelp
protected void showSymmetricKeyHelp()
-
create_symmetric_keys
public void create_symmetric_keys(edu.uiuc.ncsa.security.util.cli.InputLine inputLine)
-
createJWK
public static edu.uiuc.ncsa.security.util.jwk.JSONWebKey createJWK(String algorithm) throws InvalidAlgorithmParameterException, NoSuchAlgorithmException
-
createRSAJWK
public static edu.uiuc.ncsa.security.util.jwk.JSONWebKey createRSAJWK(int size, String algorithm) throws InvalidAlgorithmParameterException, NoSuchAlgorithmException
-
getJwkUtil2
public static edu.uiuc.ncsa.security.util.jwk.JWKUtil2 getJwkUtil2()
-
setJwkUtil2
public static void setJwkUtil2(edu.uiuc.ncsa.security.util.jwk.JWKUtil2 newJWKUtil2)
-
createECJWK
public static edu.uiuc.ncsa.security.util.jwk.JSONWebKey createECJWK(String curve, String algorithm) throws InvalidAlgorithmParameterException, NoSuchAlgorithmException
-
createJWK
public static edu.uiuc.ncsa.security.util.jwk.JSONWebKey createJWK(String algorithm, boolean isRSA) throws InvalidAlgorithmParameterException, NoSuchAlgorithmException
-
-