diff --git a/.settings/org.eclipse.buildship.core.prefs b/.settings/org.eclipse.buildship.core.prefs index 3c207820..e8895216 100644 --- a/.settings/org.eclipse.buildship.core.prefs +++ b/.settings/org.eclipse.buildship.core.prefs @@ -1,10 +1,2 @@ -build.commands=org.eclipse.jdt.core.javabuilder -connection.arguments= -connection.java.home=null -connection.jvm.arguments= connection.project.dir= -containers=org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7/ -derived.resources=.gradle,build eclipse.preferences.version=1 -natures=org.eclipse.jdt.core.javanature -project.path=\: diff --git a/maxkey-client-sdk/.classpath b/maxkey-client-sdk/.classpath index b79fc0c5..7a7f31fe 100644 --- a/maxkey-client-sdk/.classpath +++ b/maxkey-client-sdk/.classpath @@ -10,6 +10,7 @@ + diff --git a/maxkey-core/.classpath b/maxkey-core/.classpath index a9cfdaea..319c4a47 100644 --- a/maxkey-core/.classpath +++ b/maxkey-core/.classpath @@ -10,6 +10,7 @@ + diff --git a/maxkey-core/.settings/org.eclipse.jdt.core.prefs b/maxkey-core/.settings/org.eclipse.jdt.core.prefs index 8345447b..c2257d97 100644 --- a/maxkey-core/.settings/org.eclipse.jdt.core.prefs +++ b/maxkey-core/.settings/org.eclipse.jdt.core.prefs @@ -8,9 +8,122 @@ org.eclipse.jdt.core.circularClasspath=warning org.eclipse.jdt.core.classpath.exclusionPatterns=enabled org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled org.eclipse.jdt.core.classpath.outputOverlappingAnotherSource=error +org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled +org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore +org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull +org.eclipse.jdt.core.compiler.annotation.nonnull.secondary= +org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault +org.eclipse.jdt.core.compiler.annotation.nonnullbydefault.secondary= +org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable +org.eclipse.jdt.core.compiler.annotation.nullable.secondary= +org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate org.eclipse.jdt.core.compiler.maxProblemPerUnit=100 +org.eclipse.jdt.core.compiler.problem.APILeak=warning +org.eclipse.jdt.core.compiler.problem.annotatedTypeArgumentToUnannotated=info +org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.autoboxing=ignore +org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning +org.eclipse.jdt.core.compiler.problem.deadCode=warning +org.eclipse.jdt.core.compiler.problem.deprecation=warning +org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled +org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled +org.eclipse.jdt.core.compiler.problem.discouragedReference=warning +org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore +org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore +org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore +org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled +org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore +org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning +org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning +org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning +org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning +org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled +org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning +org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning +org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore +org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore +org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning +org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore +org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore +org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled +org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled +org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning +org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore +org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning +org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning +org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore +org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning +org.eclipse.jdt.core.compiler.problem.nonnullTypeVariableFromLegacyInvocation=warning +org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error +org.eclipse.jdt.core.compiler.problem.nullReference=warning +org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error +org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning +org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning +org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore +org.eclipse.jdt.core.compiler.problem.pessimisticNullAnalysisForFreeTypeVariables=warning +org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore +org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore +org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore +org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning +org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning +org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore +org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore +org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore +org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore +org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled +org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning +org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled +org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled +org.eclipse.jdt.core.compiler.problem.suppressWarningsNotFullyAnalysed=info +org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled +org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore +org.eclipse.jdt.core.compiler.problem.terminalDeprecation=warning +org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning +org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled +org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning +org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning +org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore +org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning +org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentType=warning +org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentTypeStrict=disabled +org.eclipse.jdt.core.compiler.problem.unlikelyEqualsArgumentType=info +org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore +org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=ignore +org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore +org.eclipse.jdt.core.compiler.problem.unstableAutoModuleName=warning +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled +org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter=ignore +org.eclipse.jdt.core.compiler.problem.unusedImport=warning +org.eclipse.jdt.core.compiler.problem.unusedLabel=warning +org.eclipse.jdt.core.compiler.problem.unusedLocal=warning +org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore +org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore +org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled +org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled +org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled +org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning +org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore +org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning +org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning +org.eclipse.jdt.core.compiler.release=disabled org.eclipse.jdt.core.compiler.source=1.8 org.eclipse.jdt.core.incompatibleJDKLevel=ignore org.eclipse.jdt.core.incompleteClasspath=error diff --git a/maxkey-core/src/main/java/org/maxkey/crypto/ReciprocalUtils.java b/maxkey-core/src/main/java/org/maxkey/crypto/ReciprocalUtils.java index 1c4d6135..0316c5be 100644 --- a/maxkey-core/src/main/java/org/maxkey/crypto/ReciprocalUtils.java +++ b/maxkey-core/src/main/java/org/maxkey/crypto/ReciprocalUtils.java @@ -27,248 +27,242 @@ import org.maxkey.util.StringGenerator; */ public final class ReciprocalUtils { - private static final String defaultKey = "l0JqT7NvIzP9oRaG4kFc1QmD_bWu3x8E5yS2h6"; // + private static final String defaultKey = "l0JqT7NvIzP9oRaG4kFc1QmD_bWu3x8E5yS2h6"; // - public final class Algorithm { - public static final String DES = "DES"; - public static final String DESede = "DESede"; - public static final String Blowfish = "Blowfish"; - public static final String AES = "AES"; - } + public final class Algorithm { + public static final String DES = "DES"; + public static final String DESede = "DESede"; + public static final String Blowfish = "Blowfish"; + public static final String AES = "AES"; + } - public static byte[] encode(byte[] simpleBytes, SecretKey secretKey,String algorithm) { - // Create the ciphers - Cipher ecipher; - byte[] byteFinal = null; - try { - ecipher = Cipher.getInstance(secretKey.getAlgorithm()); - // Encode the string into bytes using utf-8 - ecipher.init(Cipher.ENCRYPT_MODE, secretKey); - // Encrypt - byteFinal = ecipher.doFinal(simpleBytes); - return byteFinal; - } catch (Exception e) { - e.printStackTrace(); - } - return null; - } + public static byte[] encode(byte[] simpleBytes, SecretKey secretKey, String algorithm) { + // Create the ciphers + Cipher ecipher; + byte[] byteFinal = null; + try { + ecipher = Cipher.getInstance(secretKey.getAlgorithm()); + // Encode the string into bytes using utf-8 + ecipher.init(Cipher.ENCRYPT_MODE, secretKey); + // Encrypt + byteFinal = ecipher.doFinal(simpleBytes); + return byteFinal; + } catch (Exception e) { + e.printStackTrace(); + } + return null; + } - /** - * @param simple - * @param secretKey - * must length - * @return - * @throws Exception - */ - public static byte[] encode(String simple, String secretKey,String algorithm) { - if (keyLengthCheck(secretKey, algorithm)) { - SecretKey key = generatorKey(secretKey, algorithm); - try { - return encode(simple.getBytes("UTF-8"), key, algorithm); - } catch (UnsupportedEncodingException e) { - e.printStackTrace(); - } - } - return null; - } + /** + * @param simple + * @param secretKey must length + * @return + * @throws Exception + */ + public static byte[] encode(String simple, String secretKey, String algorithm) { + if (keyLengthCheck(secretKey, algorithm)) { + SecretKey key = generatorKey(secretKey, algorithm); + try { + return encode(simple.getBytes("UTF-8"), key, algorithm); + } catch (UnsupportedEncodingException e) { + e.printStackTrace(); + } + } + return null; + } - public static byte[] decoder(byte[] ciphersBytes, SecretKey secretKey,String algorithm) { - Cipher cipher; - byte[] byteFinal = null; - try { - cipher = Cipher.getInstance(algorithm); - cipher.init(Cipher.DECRYPT_MODE, secretKey); - byteFinal = cipher.doFinal(ciphersBytes); - // String simple=new String(byteFinal, "UTF8" ); - // return simple; - return byteFinal; - } catch (Exception e) { - e.printStackTrace(); - } finally { - cipher = null; - } - return null; - } + public static byte[] decoder(byte[] ciphersBytes, SecretKey secretKey, String algorithm) { + Cipher cipher; + byte[] byteFinal = null; + try { + cipher = Cipher.getInstance(algorithm); + cipher.init(Cipher.DECRYPT_MODE, secretKey); + byteFinal = cipher.doFinal(ciphersBytes); + // String simple=new String(byteFinal, "UTF8" ); + // return simple; + return byteFinal; + } catch (Exception e) { + e.printStackTrace(); + } finally { + cipher = null; + } + return null; + } - public static String decoder(byte[] ciphersBytes, String secretKey,String algorithm) { - if (keyLengthCheck(secretKey, algorithm)) { - SecretKey key = generatorKey(secretKey, algorithm); - try { - return new String(decoder(ciphersBytes, key, algorithm), "UTF8"); - } catch (UnsupportedEncodingException e) { - e.printStackTrace(); - } - } - return null; - } + public static String decoder(byte[] ciphersBytes, String secretKey, String algorithm) { + if (keyLengthCheck(secretKey, algorithm)) { + SecretKey key = generatorKey(secretKey, algorithm); + try { + return new String(decoder(ciphersBytes, key, algorithm), "UTF8"); + } catch (UnsupportedEncodingException e) { + e.printStackTrace(); + } + } + return null; + } - public static byte[] encodeByDefaultKey(String simple, String algorithm) { - SecretKey key = generatorDefaultKey(algorithm); - return encode(simple.getBytes(), key, algorithm); + public static byte[] encodeByDefaultKey(String simple, String algorithm) { + SecretKey key = generatorDefaultKey(algorithm); + return encode(simple.getBytes(), key, algorithm); - } + } - public static String encode2HexByDefaultKey(String simple, String algorithm) { - byte[] byteFinal = encodeByDefaultKey(simple, algorithm); + public static String encode2HexByDefaultKey(String simple, String algorithm) { + byte[] byteFinal = encodeByDefaultKey(simple, algorithm); - String cipherHex = HexUtils.bytes2HexString(byteFinal); - return cipherHex; - } + String cipherHex = HexUtils.bytes2HexString(byteFinal); + return cipherHex; + } - public static byte[] decoderByDefaultKey(byte[] byteCiphers,String algorithm) { - SecretKey key = generatorDefaultKey(algorithm); - return decoder(byteCiphers, key, algorithm); + public static byte[] decoderByDefaultKey(byte[] byteCiphers, String algorithm) { + SecretKey key = generatorDefaultKey(algorithm); + return decoder(byteCiphers, key, algorithm); - } + } - public static String decoderHexByDefaultKey(String ciphers, String algorithm) { - byte[] byteSimple = HexUtils.hex2Bytes(ciphers); - - byte[] byteFinal = decoderByDefaultKey(byteSimple, algorithm); + public static String decoderHexByDefaultKey(String ciphers, String algorithm) { + byte[] byteSimple = HexUtils.hex2Bytes(ciphers); - String simple = null; - try { - simple = new String(byteFinal, "UTF-8"); - } catch (UnsupportedEncodingException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - return simple; + byte[] byteFinal = decoderByDefaultKey(byteSimple, algorithm); - } + String simple = null; + try { + simple = new String(byteFinal, "UTF-8"); + } catch (UnsupportedEncodingException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + return simple; - public static SecretKey generatorDefaultKey(String algorithm) { - try { - Security.addProvider(new com.sun.crypto.provider.SunJCE()); - String secretKey=defaultKey; - if(algorithm.equals(Algorithm.DES)){ - secretKey=defaultKey.substring(0, 8); - }else if(algorithm.equals(Algorithm.AES)||algorithm.equals(Algorithm.Blowfish)){ - secretKey=defaultKey.substring(0, 16); - }else if(algorithm.equals(Algorithm.DESede)){ - secretKey=defaultKey.substring(0, 24); - } - //System.out.println("defaultKey : "+secretKey); - SecretKey key = new SecretKeySpec(secretKey.getBytes(), algorithm); - return key; - } catch (Exception e) { - e.printStackTrace(); - } - return null; - } + } - private static SecretKey generatorKey(String secretKey, String algorithm) { - try { - SecretKey key = new SecretKeySpec(secretKey.getBytes(), algorithm); - return key; - } catch (Exception e) { - e.printStackTrace(); - } - return null; - } + public static SecretKey generatorDefaultKey(String algorithm) { + try { + Security.addProvider(new com.sun.crypto.provider.SunJCE()); + String secretKey = defaultKey; + if (algorithm.equals(Algorithm.DES)) { + secretKey = defaultKey.substring(0, 8); + } else if (algorithm.equals(Algorithm.AES) || algorithm.equals(Algorithm.Blowfish)) { + secretKey = defaultKey.substring(0, 16); + } else if (algorithm.equals(Algorithm.DESede)) { + secretKey = defaultKey.substring(0, 24); + } + // System.out.println("defaultKey : "+secretKey); + SecretKey key = new SecretKeySpec(secretKey.getBytes(), algorithm); + return key; + } catch (Exception e) { + e.printStackTrace(); + } + return null; + } - public static String encode2Hex(String simple, String secretKey,String algorithm) { - if (keyLengthCheck(secretKey, algorithm)) { - byte[] cipher = encode(simple, secretKey, algorithm); - // Encode bytes to HEX to get a string - return HexUtils.bytes2HexString(cipher); - } - return null; - } + private static SecretKey generatorKey(String secretKey, String algorithm) { + try { + SecretKey key = new SecretKeySpec(secretKey.getBytes(), algorithm); + return key; + } catch (Exception e) { + e.printStackTrace(); + } + return null; + } - public static String decoderHex(String ciphers, String secretKey,String algorithm) { - if (keyLengthCheck(secretKey, algorithm)) { - byte[] byteSimple = HexUtils.hex2Bytes(ciphers); + public static String encode2Hex(String simple, String secretKey, String algorithm) { + if (keyLengthCheck(secretKey, algorithm)) { + byte[] cipher = encode(simple, secretKey, algorithm); + // Encode bytes to HEX to get a string + return HexUtils.bytes2HexString(cipher); + } + return null; + } - return decoder(byteSimple, secretKey, algorithm); - } - return null; - } + public static String decoderHex(String ciphers, String secretKey, String algorithm) { + if (keyLengthCheck(secretKey, algorithm)) { + byte[] byteSimple = HexUtils.hex2Bytes(ciphers); - private static boolean keyLengthCheck(String secretKey, String algorithm) { - boolean lengthCheck = false; - if (algorithm.equals(Algorithm.DES)) { - if (secretKey.length() == 8) { - lengthCheck = true; - } else { - LogFactory.getLog(ReciprocalUtils.class).debug( - "key length is " + secretKey.getBytes().length - + " ,must lequal 8"); - } - } else if (algorithm.equals(Algorithm.DESede)) { - if (secretKey.length() == 24) { - lengthCheck = true; - } else { - LogFactory.getLog(ReciprocalUtils.class).debug( - "key length is " + secretKey.getBytes().length - + " ,must equal 24"); - } - } else if (algorithm.equals(Algorithm.AES)) { - if (secretKey.length() == 16) { - lengthCheck = true; - } else { - LogFactory.getLog(ReciprocalUtils.class).debug( - "key length is " + secretKey.getBytes().length - + " ,must equal 16"); - } - } else if (algorithm.equals(Algorithm.Blowfish)) { - if (secretKey.length() <= 16) { - lengthCheck = true; - } else { - LogFactory.getLog(ReciprocalUtils.class).debug( - "key length is " + secretKey.getBytes().length - + " ,must be less then 16"); - } - } - return lengthCheck; - } + return decoder(byteSimple, secretKey, algorithm); + } + return null; + } - /** - * @param simple - * @param secretKey - * must length is 16 - * @return - */ - public static String aesEncode(String simple, String secretKey) { - return encode2Hex(simple, secretKey, Algorithm.AES); - } + private static boolean keyLengthCheck(String secretKey, String algorithm) { + boolean lengthCheck = false; + if (algorithm.equals(Algorithm.DES)) { + if (secretKey.length() == 8) { + lengthCheck = true; + } else { + LogFactory.getLog(ReciprocalUtils.class) + .debug("key length is " + secretKey.getBytes().length + " ,must lequal 8"); + } + } else if (algorithm.equals(Algorithm.DESede)) { + if (secretKey.length() == 24) { + lengthCheck = true; + } else { + LogFactory.getLog(ReciprocalUtils.class) + .debug("key length is " + secretKey.getBytes().length + " ,must equal 24"); + } + } else if (algorithm.equals(Algorithm.AES)) { + if (secretKey.length() == 16) { + lengthCheck = true; + } else { + LogFactory.getLog(ReciprocalUtils.class) + .debug("key length is " + secretKey.getBytes().length + " ,must equal 16"); + } + } else if (algorithm.equals(Algorithm.Blowfish)) { + if (secretKey.length() <= 16) { + lengthCheck = true; + } else { + LogFactory.getLog(ReciprocalUtils.class) + .debug("key length is " + secretKey.getBytes().length + " ,must be less then 16"); + } + } + return lengthCheck; + } - public static String aesDecoder(String ciphers, String secretKey) { - return decoderHex(ciphers, secretKey, Algorithm.AES); - } + /** + * @param simple + * @param secretKey must length is 16 + * @return + */ + public static String aesEncode(String simple, String secretKey) { + return encode2Hex(simple, secretKey, Algorithm.AES); + } - /** - * encode by defaultKey with Algorithm.AES - * - * @param simple - * @return Hex - */ - public static String encode(String simple) { - return encode2HexByDefaultKey(simple, Algorithm.AES); - } + public static String aesDecoder(String ciphers, String secretKey) { + return decoderHex(ciphers, secretKey, Algorithm.AES); + } - /** - * decoder by defaultKey with Algorithm.AES - * - * @param ciphers is HEX - * - * @return - */ - public static String decoder(String ciphers) { - return decoderHexByDefaultKey(ciphers, Algorithm.AES); - } + /** + * encode by defaultKey with Algorithm.AES + * + * @param simple + * @return Hex + */ + public static String encode(String simple) { + return encode2HexByDefaultKey(simple, Algorithm.AES); + } - public static String generateKey(String algorithm) { - if (algorithm.equals(Algorithm.DES)) { - return (new StringGenerator(8)).randomGenerate(); - } else if (algorithm.equals(Algorithm.AES)) { - return (new StringGenerator(16)).randomGenerate(); - } else if (algorithm.equals(Algorithm.Blowfish)) { - return (new StringGenerator(16)).randomGenerate(); - } else if (algorithm.equals(Algorithm.DESede)) { - return (new StringGenerator(24)).randomGenerate(); - } else { - return (new StringGenerator()).uniqueGenerate(); - } - } + /** + * decoder by defaultKey with Algorithm.AES + * + * @param ciphers is HEX + * + * @return + */ + public static String decoder(String ciphers) { + return decoderHexByDefaultKey(ciphers, Algorithm.AES); + } + + public static String generateKey(String algorithm) { + if (algorithm.equals(Algorithm.DES)) { + return (new StringGenerator(8)).randomGenerate(); + } else if (algorithm.equals(Algorithm.AES)) { + return (new StringGenerator(16)).randomGenerate(); + } else if (algorithm.equals(Algorithm.Blowfish)) { + return (new StringGenerator(16)).randomGenerate(); + } else if (algorithm.equals(Algorithm.DESede)) { + return (new StringGenerator(24)).randomGenerate(); + } else { + return (new StringGenerator()).uniqueGenerate(); + } + } } diff --git a/maxkey-core/src/main/java/org/maxkey/domain/apps/AppsSAML20Details.java b/maxkey-core/src/main/java/org/maxkey/domain/apps/AppsSAML20Details.java index 1aacb59d..0cd3486e 100644 --- a/maxkey-core/src/main/java/org/maxkey/domain/apps/AppsSAML20Details.java +++ b/maxkey-core/src/main/java/org/maxkey/domain/apps/AppsSAML20Details.java @@ -14,401 +14,295 @@ import org.springframework.web.multipart.MultipartFile; * @author Crystal.Sea * */ -@Table(name = "APPS_SAML_V20_DETAILS") -public class AppsSAML20Details extends Apps { - - /** - * - */ - private static final long serialVersionUID = -291159876339333345L; - @Id - @Column - @GeneratedValue(strategy=GenerationType.AUTO,generator="uuid") - protected String id; - @Column - private String certIssuer; - @Column - private String certSubject; - @Column - private String certExpiration; - @Column - private byte[] keyStore; - - private String entityId; - @Column - private String spAcsUrl; - @Column - private String issuer; - @Column - private String audience; - @Column - private String nameidFormat; - @Column - private String validityInterval; - /** - * Redirect-Post - * Post-Post - * IdpInit-Post - * Redirect-PostSimpleSign - * Post-PostSimpleSign - * IdpInit-PostSimpleSign - */ - @Column - private String binding; - - /** - * 0 false - * 1 true - */ - @Column - private int encrypted; - - /** - * for upload - */ - private MultipartFile certMetaFile; - /** - * metadata or certificate - */ - private String fileType; - - /** - * 0 original - * 1 uppercase - * 2 lowercase - */ - @Column - private int nameIdConvert; - - - public static class BINDINGTYPE{ - public String Redirect_Post="Redirect-Post"; - public String Post_Post="Post-Post"; - public String IdpInit_Post="IdpInit-Post"; - public String Redirect_PostSimpleSign="Redirect-PostSimpleSign"; - public String Post_PostSimpleSign="Post-PostSimpleSign"; - public String IdpInit_PostSimpleSign="IdpInit-PostSimpleSign"; - } - - - - /** - * - */ - public AppsSAML20Details() { - super(); - - } - - - public String getId() { - return id; - } - - - public void setId(String id) { - this.id = id; - } - - - /** - * @return the certIssuer - */ - public String getCertIssuer() { - return certIssuer; - } - - - - - /** - * @param certIssuer the certIssuer to set - */ - public void setCertIssuer(String certIssuer) { - this.certIssuer = certIssuer; - } - - - - - /** - * @return the certSubject - */ - public String getCertSubject() { - return certSubject; - } - - - - - /** - * @param certSubject the certSubject to set - */ - public void setCertSubject(String certSubject) { - this.certSubject = certSubject; - } - - - - - /** - * @return the certExpiration - */ - public String getCertExpiration() { - return certExpiration; - } - - - - - /** - * @param certExpiration the certExpiration to set - */ - public void setCertExpiration(String certExpiration) { - this.certExpiration = certExpiration; - } - - - - - /** - * @return the keyStore - */ - public byte[] getKeyStore() { - return keyStore; - } - - - - - /** - * @param keyStore the keyStore to set - */ - public void setKeyStore(byte[] keyStore) { - this.keyStore = keyStore; - } - - - - - /** - * @return the entityId - */ - public String getEntityId() { - return entityId; - } - - - - - /** - * @param entityId the entityId to set - */ - public void setEntityId(String entityId) { - this.entityId = entityId; - } - - - - - /** - * @return the spAcsUrl - */ - public String getSpAcsUrl() { - return spAcsUrl; - } - - - - - /** - * @param spAcsUrl the spAcsUrl to set - */ - public void setSpAcsUrl(String spAcsUrl) { - this.spAcsUrl = spAcsUrl; - } - - - - - /** - * @return the issuer - */ - public String getIssuer() { - return issuer; - } - - - - - /** - * @param issuer the issuer to set - */ - public void setIssuer(String issuer) { - this.issuer = issuer; - } - - - - - - /** - * @return the audience - */ - public String getAudience() { - return audience; - } - - - - - /** - * @param audience the audience to set - */ - public void setAudience(String audience) { - this.audience = audience; - } - - - - - /** - * @return the nameidFormat - */ - public String getNameidFormat() { - return nameidFormat; - } - - - - - /** - * @param nameidFormat the nameidFormat to set - */ - public void setNameidFormat(String nameidFormat) { - this.nameidFormat = nameidFormat; - } - - - - - /** - * @return the validityInterval - */ - public String getValidityInterval() { - return validityInterval; - } - - - - - /** - * @param validityInterval the validityInterval to set - */ - public void setValidityInterval(String validityInterval) { - this.validityInterval = validityInterval; - } - - - - - /** - * @return the certMetaFile - */ - public MultipartFile getCertMetaFile() { - return certMetaFile; - } - - - - - /** - * @param certMetaFile the certMetaFile to set - */ - public void setCertMetaFile(MultipartFile certMetaFile) { - this.certMetaFile = certMetaFile; - } - - - - - /** - * @return the fileType - */ - public String getFileType() { - return fileType; - } - - - - - /** - * @param fileType the fileType to set - */ - public void setFileType(String fileType) { - this.fileType = fileType; - } - - - - - public String getBinding() { - return binding; - } - - - - - public void setBinding(String binding) { - this.binding = binding; - } - - - public int getEncrypted() { - return encrypted; - } - - - - - public void setEncrypted(int encrypted) { - this.encrypted = encrypted; - } - - - - - public int getNameIdConvert() { - return nameIdConvert; - } - - - - - public void setNameIdConvert(int nameIdConvert) { - this.nameIdConvert = nameIdConvert; - } - - - /* (non-Javadoc) - * @see java.lang.Object#toString() - */ - @Override - public String toString() { - return "SAMLBaseDetails [certIssuer=" + certIssuer + ", certSubject=" - + certSubject + ", certExpiration=" + certExpiration - + ", keyStore=" + Arrays.toString(keyStore) + ", entityId=" - + entityId + ", spAcsUrl=" + spAcsUrl + ", issuer=" + issuer - + ", audience=" + audience + ", nameidFormat=" + nameidFormat - + ", validityInterval=" + validityInterval + ", binding=" - + binding + ", encrypted=" + encrypted + ", certMetaFile=" - + certMetaFile + ", fileType=" + fileType + ", nameIdConvert=" - + nameIdConvert + "]"; - } - - - - - +@Table(name = "APPS_SAML_V20_DETAILS") +public class AppsSAML20Details extends Apps { + + /** + * + */ + private static final long serialVersionUID = -291159876339333345L; + @Id + @Column + @GeneratedValue(strategy = GenerationType.AUTO, generator = "uuid") + protected String id; + @Column + private String certIssuer; + @Column + private String certSubject; + @Column + private String certExpiration; + @Column + private byte[] keyStore; + @Column + private String entityId; + @Column + private String spAcsUrl; + @Column + private String issuer; + @Column + private String audience; + @Column + private String nameidFormat; + @Column + private String validityInterval; + /** + * Redirect-Post Post-Post IdpInit-Post Redirect-PostSimpleSign + * Post-PostSimpleSign IdpInit-PostSimpleSign + */ + @Column + private String binding; + + /** + * 0 false 1 true + */ + @Column + private int encrypted; + + /** + * for upload + */ + private MultipartFile certMetaFile; + /** + * metadata or certificate + */ + private String fileType; + + /** + * 0 original 1 uppercase 2 lowercase + */ + @Column + private int nameIdConvert; + + public static class BINDINGTYPE { + public String Redirect_Post = "Redirect-Post"; + public String Post_Post = "Post-Post"; + public String IdpInit_Post = "IdpInit-Post"; + public String Redirect_PostSimpleSign = "Redirect-PostSimpleSign"; + public String Post_PostSimpleSign = "Post-PostSimpleSign"; + public String IdpInit_PostSimpleSign = "IdpInit-PostSimpleSign"; + } + + /** + * + */ + public AppsSAML20Details() { + super(); + + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + /** + * @return the certIssuer + */ + public String getCertIssuer() { + return certIssuer; + } + + /** + * @param certIssuer the certIssuer to set + */ + public void setCertIssuer(String certIssuer) { + this.certIssuer = certIssuer; + } + + /** + * @return the certSubject + */ + public String getCertSubject() { + return certSubject; + } + + /** + * @param certSubject the certSubject to set + */ + public void setCertSubject(String certSubject) { + this.certSubject = certSubject; + } + + /** + * @return the certExpiration + */ + public String getCertExpiration() { + return certExpiration; + } + + /** + * @param certExpiration the certExpiration to set + */ + public void setCertExpiration(String certExpiration) { + this.certExpiration = certExpiration; + } + + /** + * @return the keyStore + */ + public byte[] getKeyStore() { + return keyStore; + } + + /** + * @param keyStore the keyStore to set + */ + public void setKeyStore(byte[] keyStore) { + this.keyStore = keyStore; + } + + /** + * @return the entityId + */ + public String getEntityId() { + return entityId; + } + + /** + * @param entityId the entityId to set + */ + public void setEntityId(String entityId) { + this.entityId = entityId; + } + + /** + * @return the spAcsUrl + */ + public String getSpAcsUrl() { + return spAcsUrl; + } + + /** + * @param spAcsUrl the spAcsUrl to set + */ + public void setSpAcsUrl(String spAcsUrl) { + this.spAcsUrl = spAcsUrl; + } + + /** + * @return the issuer + */ + public String getIssuer() { + return issuer; + } + + /** + * @param issuer the issuer to set + */ + public void setIssuer(String issuer) { + this.issuer = issuer; + } + + /** + * @return the audience + */ + public String getAudience() { + return audience; + } + + /** + * @param audience the audience to set + */ + public void setAudience(String audience) { + this.audience = audience; + } + + /** + * @return the nameidFormat + */ + public String getNameidFormat() { + return nameidFormat; + } + + /** + * @param nameidFormat the nameidFormat to set + */ + public void setNameidFormat(String nameidFormat) { + this.nameidFormat = nameidFormat; + } + + /** + * @return the validityInterval + */ + public String getValidityInterval() { + return validityInterval; + } + + /** + * @param validityInterval the validityInterval to set + */ + public void setValidityInterval(String validityInterval) { + this.validityInterval = validityInterval; + } + + /** + * @return the certMetaFile + */ + public MultipartFile getCertMetaFile() { + return certMetaFile; + } + + /** + * @param certMetaFile the certMetaFile to set + */ + public void setCertMetaFile(MultipartFile certMetaFile) { + this.certMetaFile = certMetaFile; + } + + /** + * @return the fileType + */ + public String getFileType() { + return fileType; + } + + /** + * @param fileType the fileType to set + */ + public void setFileType(String fileType) { + this.fileType = fileType; + } + + public String getBinding() { + return binding; + } + + public void setBinding(String binding) { + this.binding = binding; + } + + public int getEncrypted() { + return encrypted; + } + + public void setEncrypted(int encrypted) { + this.encrypted = encrypted; + } + + public int getNameIdConvert() { + return nameIdConvert; + } + + public void setNameIdConvert(int nameIdConvert) { + this.nameIdConvert = nameIdConvert; + } + + /* + * (non-Javadoc) + * + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "SAMLBaseDetails [certIssuer=" + certIssuer + ", certSubject=" + certSubject + ", certExpiration=" + + certExpiration + ", keyStore=" + Arrays.toString(keyStore) + ", entityId=" + entityId + ", spAcsUrl=" + + spAcsUrl + ", issuer=" + issuer + ", audience=" + audience + ", nameidFormat=" + nameidFormat + + ", validityInterval=" + validityInterval + ", binding=" + binding + ", encrypted=" + encrypted + + ", certMetaFile=" + certMetaFile + ", fileType=" + fileType + ", nameIdConvert=" + nameIdConvert + + "]"; + } } diff --git a/maxkey-dao/.classpath b/maxkey-dao/.classpath index 540156aa..8b3d57e2 100644 --- a/maxkey-dao/.classpath +++ b/maxkey-dao/.classpath @@ -16,12 +16,14 @@ + + diff --git a/maxkey-protocols/maxkey-protocol-cas/.classpath b/maxkey-protocols/maxkey-protocol-cas/.classpath index b79fc0c5..7a7f31fe 100644 --- a/maxkey-protocols/maxkey-protocol-cas/.classpath +++ b/maxkey-protocols/maxkey-protocol-cas/.classpath @@ -10,6 +10,7 @@ + diff --git a/maxkey-protocols/maxkey-protocol-oauth-2.0/.settings/org.eclipse.jdt.core.prefs b/maxkey-protocols/maxkey-protocol-oauth-2.0/.settings/org.eclipse.jdt.core.prefs index 8345447b..013f2157 100644 --- a/maxkey-protocols/maxkey-protocol-oauth-2.0/.settings/org.eclipse.jdt.core.prefs +++ b/maxkey-protocols/maxkey-protocol-oauth-2.0/.settings/org.eclipse.jdt.core.prefs @@ -8,9 +8,20 @@ org.eclipse.jdt.core.circularClasspath=warning org.eclipse.jdt.core.classpath.exclusionPatterns=enabled org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled org.eclipse.jdt.core.classpath.outputOverlappingAnotherSource=error +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate org.eclipse.jdt.core.compiler.maxProblemPerUnit=100 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=disabled org.eclipse.jdt.core.compiler.source=1.8 org.eclipse.jdt.core.incompatibleJDKLevel=ignore org.eclipse.jdt.core.incompleteClasspath=error diff --git a/maxkey-web-manage/.project b/maxkey-web-manage/.project index 38ccd7a6..a4d8d490 100644 --- a/maxkey-web-manage/.project +++ b/maxkey-web-manage/.project @@ -4,8 +4,8 @@ maxkey-web-manage maxkey-protocol-authorize - maxkey-core maxkey-jose-jwt + maxkey-core maxkey-dao maxkey-client-sdk maxkey-protocol-oauth-2.0 diff --git a/maxkey-web-manage/.settings/org.eclipse.jdt.core.prefs b/maxkey-web-manage/.settings/org.eclipse.jdt.core.prefs index 8345447b..013f2157 100644 --- a/maxkey-web-manage/.settings/org.eclipse.jdt.core.prefs +++ b/maxkey-web-manage/.settings/org.eclipse.jdt.core.prefs @@ -8,9 +8,20 @@ org.eclipse.jdt.core.circularClasspath=warning org.eclipse.jdt.core.classpath.exclusionPatterns=enabled org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled org.eclipse.jdt.core.classpath.outputOverlappingAnotherSource=error +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate org.eclipse.jdt.core.compiler.maxProblemPerUnit=100 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=disabled org.eclipse.jdt.core.compiler.source=1.8 org.eclipse.jdt.core.incompatibleJDKLevel=ignore org.eclipse.jdt.core.incompleteClasspath=error diff --git a/maxkey-web-manage/src/main/resources/templates/views/accounts/appAccountsAdd.ftl b/maxkey-web-manage/src/main/resources/templates/views/accounts/appAccountsAdd.ftl index f0b37750..3ea91f9e 100644 --- a/maxkey-web-manage/src/main/resources/templates/views/accounts/appAccountsAdd.ftl +++ b/maxkey-web-manage/src/main/resources/templates/views/accounts/appAccountsAdd.ftl @@ -25,7 +25,7 @@ <@locale code="userinfo.username" />: - + " wurl="<@base/>/userinfo/select" wwidth="800" @@ -37,14 +37,14 @@ <@locale code="userinfo.displayName" />: - + <@locale code="apps.name" />: - + " wurl="<@base/>/apps/select" wwidth="800" @@ -56,14 +56,14 @@ <@locale code="account.relatedUsername" />: - + <@locale code="account.relatedPassword" />: - + diff --git a/maxkey-web-manage/src/main/resources/templates/views/apps/appAddCommon.ftl b/maxkey-web-manage/src/main/resources/templates/views/apps/appAddCommon.ftl index 05815cb6..88287dd4 100644 --- a/maxkey-web-manage/src/main/resources/templates/views/apps/appAddCommon.ftl +++ b/maxkey-web-manage/src/main/resources/templates/views/apps/appAddCommon.ftl @@ -20,13 +20,13 @@ <@locale code="apps.name"/>: - + <@locale code="apps.loginUrl"/>: - + @@ -37,9 +37,7 @@ <@locale code="apps.category"/>: - + @@ -49,7 +47,7 @@ <@locale code="common.text.sortindex"/> - + diff --git a/maxkey-web-manage/src/main/resources/templates/views/apps/appUpdateCommon.ftl b/maxkey-web-manage/src/main/resources/templates/views/apps/appUpdateCommon.ftl index 671e459a..ce6a6b9f 100644 --- a/maxkey-web-manage/src/main/resources/templates/views/apps/appUpdateCommon.ftl +++ b/maxkey-web-manage/src/main/resources/templates/views/apps/appUpdateCommon.ftl @@ -33,13 +33,13 @@ <@locale code="apps.name"/>: - + <@locale code="apps.loginUrl"/>: - + @@ -49,9 +49,7 @@ <@locale code="apps.category"/>: - + @@ -60,7 +58,7 @@ <@locale code="common.text.sortindex"/> - + diff --git a/maxkey-web-manage/src/main/resources/templates/views/apps/appsExtendAttr.ftl b/maxkey-web-manage/src/main/resources/templates/views/apps/appsExtendAttr.ftl index 9a9e96e5..d789609d 100644 --- a/maxkey-web-manage/src/main/resources/templates/views/apps/appsExtendAttr.ftl +++ b/maxkey-web-manage/src/main/resources/templates/views/apps/appsExtendAttr.ftl @@ -22,15 +22,15 @@ $(function(){ html += ''; //attribute html += ''; - html += ''; + html += ''; html += ''; //attributeType html += '<@locale code="apps.extendAttr.parameter.type"/>: '; - html += ''; + html += ''; html += ''; //attributeValue html += '<@locale code="apps.extendAttr.parameter.value"/>: '; - html += ''; + html += ''; html += ''; html += ''; diff --git a/maxkey-web-manage/src/main/resources/templates/views/apps/cas/appAdd.ftl b/maxkey-web-manage/src/main/resources/templates/views/apps/cas/appAdd.ftl index 03a3ea06..98eea2c1 100644 --- a/maxkey-web-manage/src/main/resources/templates/views/apps/cas/appAdd.ftl +++ b/maxkey-web-manage/src/main/resources/templates/views/apps/cas/appAdd.ftl @@ -47,15 +47,13 @@ $(function(){ <@locale code="apps.cas.service"/>: - - * + <@locale code="apps.cas.validation"/>: - - * + diff --git a/maxkey-web-manage/src/main/resources/templates/views/apps/cas/appUpdate.ftl b/maxkey-web-manage/src/main/resources/templates/views/apps/cas/appUpdate.ftl index e327547d..582b8152 100644 --- a/maxkey-web-manage/src/main/resources/templates/views/apps/cas/appUpdate.ftl +++ b/maxkey-web-manage/src/main/resources/templates/views/apps/cas/appUpdate.ftl @@ -57,13 +57,13 @@ $(function(){ <@locale code="apps.cas.service"/>: - + <@locale code="apps.cas.validation"/>: - + diff --git a/maxkey-web-manage/src/main/resources/templates/views/apps/desktop/appAdd.ftl b/maxkey-web-manage/src/main/resources/templates/views/apps/desktop/appAdd.ftl index 34090972..246d57b5 100644 --- a/maxkey-web-manage/src/main/resources/templates/views/apps/desktop/appAdd.ftl +++ b/maxkey-web-manage/src/main/resources/templates/views/apps/desktop/appAdd.ftl @@ -86,7 +86,7 @@ $(function(){ <@locale code="apps.desktop.programPath" />: - + * @@ -110,7 +110,7 @@ $(function(){ <@locale code="apps.desktop.usernameParameter" />: - + * @@ -132,7 +132,7 @@ $(function(){ <@locale code="apps.desktop.passwordParameter" />: - + * diff --git a/maxkey-web-manage/src/main/resources/templates/views/apps/desktop/appUpdate.ftl b/maxkey-web-manage/src/main/resources/templates/views/apps/desktop/appUpdate.ftl index 506bec0f..30b45460 100644 --- a/maxkey-web-manage/src/main/resources/templates/views/apps/desktop/appUpdate.ftl +++ b/maxkey-web-manage/src/main/resources/templates/views/apps/desktop/appUpdate.ftl @@ -93,7 +93,7 @@ $(function(){ <@locale code="apps.desktop.programPath" />: - + @@ -117,7 +117,7 @@ $(function(){ style="display:none" > <@locale code="apps.desktop.usernameParameter" />: style="display:none" > - + @@ -141,7 +141,7 @@ $(function(){ style="display:none" > <@locale code="apps.desktop.passwordParameter" />: style="display:none" > - + diff --git a/maxkey-web-manage/src/main/resources/templates/views/apps/extendapi/appAdd.ftl b/maxkey-web-manage/src/main/resources/templates/views/apps/extendapi/appAdd.ftl index 751e3e06..a29b14b9 100644 --- a/maxkey-web-manage/src/main/resources/templates/views/apps/extendapi/appAdd.ftl +++ b/maxkey-web-manage/src/main/resources/templates/views/apps/extendapi/appAdd.ftl @@ -33,8 +33,8 @@ $(function(){
@@ -50,13 +50,11 @@ $(function(){ <@locale code="apps.principal"/>: - - * + <@locale code="apps.credentials"/>: - - * + diff --git a/maxkey-web-manage/src/main/resources/templates/views/apps/extendapi/appUpdate.ftl b/maxkey-web-manage/src/main/resources/templates/views/apps/extendapi/appUpdate.ftl index 19914cf4..a9ef4e62 100644 --- a/maxkey-web-manage/src/main/resources/templates/views/apps/extendapi/appUpdate.ftl +++ b/maxkey-web-manage/src/main/resources/templates/views/apps/extendapi/appUpdate.ftl @@ -54,12 +54,12 @@ $(function(){ <@locale code="apps.principal"/>: - + <@locale code="apps.credentials"/>: - + diff --git a/maxkey-web-manage/src/main/resources/templates/views/apps/formbased/appAdd.ftl b/maxkey-web-manage/src/main/resources/templates/views/apps/formbased/appAdd.ftl index 06a04674..92b894ee 100644 --- a/maxkey-web-manage/src/main/resources/templates/views/apps/formbased/appAdd.ftl +++ b/maxkey-web-manage/src/main/resources/templates/views/apps/formbased/appAdd.ftl @@ -53,7 +53,7 @@ $(function(){ <@locale code="apps.formbased.redirectUri"/>: - + * @@ -61,12 +61,12 @@ $(function(){ <@locale code="apps.formbased.usernameMapping"/>: - + * <@locale code="apps.formbased.passwordMapping"/>: - + * diff --git a/maxkey-web-manage/src/main/resources/templates/views/apps/formbased/appUpdate.ftl b/maxkey-web-manage/src/main/resources/templates/views/apps/formbased/appUpdate.ftl index 47652603..f1e49f3d 100644 --- a/maxkey-web-manage/src/main/resources/templates/views/apps/formbased/appUpdate.ftl +++ b/maxkey-web-manage/src/main/resources/templates/views/apps/formbased/appUpdate.ftl @@ -58,19 +58,19 @@ $(function(){ <@locale code="apps.formbased.redirectUri"/>: - + - + <@locale code="apps.formbased.usernameMapping"/>: - + <@locale code="apps.formbased.passwordMapping"/>: - + diff --git a/maxkey-web-manage/src/main/resources/templates/views/apps/oauth20/appUpdate.ftl b/maxkey-web-manage/src/main/resources/templates/views/apps/oauth20/appUpdate.ftl index b5dc39c8..da84fbe0 100644 --- a/maxkey-web-manage/src/main/resources/templates/views/apps/oauth20/appUpdate.ftl +++ b/maxkey-web-manage/src/main/resources/templates/views/apps/oauth20/appUpdate.ftl @@ -90,7 +90,6 @@ $(function(){ id_tokenchecked type="checkbox" id="grantTypes_id_token" name="authorizedGrantTypes" value="id_token"/> tokenchecked type="checkbox" id="grantTypes_token" name="authorizedGrantTypes" value="token"/> - * @@ -98,20 +97,20 @@ $(function(){ <@locale code="apps.oauth.registeredRedirectUris" />: - - * + + <@locale code="apps.oauth.accessTokenValiditySeconds" />: - * + <@locale code="apps.oauth.refreshTokenValiditySeconds" />: - * + diff --git a/maxkey-web-manage/src/main/resources/templates/views/apps/saml20/appAdd.ftl b/maxkey-web-manage/src/main/resources/templates/views/apps/saml20/appAdd.ftl index 36765760..f8bf6b3e 100644 --- a/maxkey-web-manage/src/main/resources/templates/views/apps/saml20/appAdd.ftl +++ b/maxkey-web-manage/src/main/resources/templates/views/apps/saml20/appAdd.ftl @@ -38,35 +38,27 @@ $(function(){ <@locale code="apps.saml.v2.0.info" /> + <@locale code="apps.saml.spAcsUrl" />: + + + + + <@locale code="apps.saml.entityId" />: - - * + - - - <@locale code="apps.saml.issuer" />: - - * - - - - - <@locale code="apps.saml.spAcsUrl" />: - - - * + - <@locale code="apps.saml.audience" />: - + @@ -114,7 +106,7 @@ $(function(){ <@locale code="apps.saml.validityInterval" />: - + diff --git a/maxkey-web-manage/src/main/resources/templates/views/apps/saml20/appUpdate.ftl b/maxkey-web-manage/src/main/resources/templates/views/apps/saml20/appUpdate.ftl index 21dd7b05..3c4d995d 100644 --- a/maxkey-web-manage/src/main/resources/templates/views/apps/saml20/appUpdate.ftl +++ b/maxkey-web-manage/src/main/resources/templates/views/apps/saml20/appUpdate.ftl @@ -51,29 +51,27 @@ $(function(){ <@locale code="apps.saml.v2.0.info" /> + <@locale code="apps.saml.spAcsUrl" />: + + + + + <@locale code="apps.saml.entityId" />: - - - - - - - <@locale code="apps.saml.spAcsUrl" />: - - + <@locale code="apps.saml.issuer" />: - + <@locale code="apps.saml.audience" />: - + SAML MetaData @@ -165,15 +163,15 @@ $(function(){ <@locale code="apps.saml.certIssuer" />: - ${model.certIssuer} + ${model.certIssuer!} <@locale code="apps.saml.certExpiration" />: - ${model.certExpiration} + ${model.certExpiration!} <@locale code="apps.saml.certSubject" />: - ${model.certSubject} + ${model.certSubject!} diff --git a/maxkey-web-manage/src/main/resources/templates/views/apps/tokenbased/appAdd.ftl b/maxkey-web-manage/src/main/resources/templates/views/apps/tokenbased/appAdd.ftl index 168e59fd..817761f3 100644 --- a/maxkey-web-manage/src/main/resources/templates/views/apps/tokenbased/appAdd.ftl +++ b/maxkey-web-manage/src/main/resources/templates/views/apps/tokenbased/appAdd.ftl @@ -53,8 +53,7 @@ $(function(){ <@locale code="apps.tokenbased.redirectUri" />: - - * + @@ -68,7 +67,6 @@ $(function(){ <@locale code="apps.tokenbased.cookieName" />: - * @@ -97,7 +95,7 @@ $(function(){ - + @@ -110,7 +108,7 @@ $(function(){ @@ -117,7 +117,7 @@ $(function(){ diff --git a/maxkey-web-manage/src/main/resources/templates/views/groups/groupUpdate.ftl b/maxkey-web-manage/src/main/resources/templates/views/groups/groupUpdate.ftl index 2669ceea..700f8799 100644 --- a/maxkey-web-manage/src/main/resources/templates/views/groups/groupUpdate.ftl +++ b/maxkey-web-manage/src/main/resources/templates/views/groups/groupUpdate.ftl @@ -23,7 +23,7 @@ diff --git a/maxkey-web-maxkey/.classpath b/maxkey-web-maxkey/.classpath index 1501fbb1..4d08c1f6 100644 --- a/maxkey-web-maxkey/.classpath +++ b/maxkey-web-maxkey/.classpath @@ -16,6 +16,7 @@ + diff --git a/maxkey-web-maxkey/.project b/maxkey-web-maxkey/.project index 9dac6049..78ce2caa 100644 --- a/maxkey-web-maxkey/.project +++ b/maxkey-web-maxkey/.project @@ -3,20 +3,20 @@ maxkey-web-maxkey maxkey-web-maxkey - maxkey-protocol-desktop - maxkey-protocol-tokenbased - maxkey-client-sdk maxkey-jose-jwt - maxkey-protocol-authorize - maxkey-protocol-saml-2.0 - maxkey-protocol-oauth-2.0 - maxkey-authentications - maxkey-protocol-formbased maxkey-protocol-simulate - maxkey-dao + maxkey-protocol-oauth-2.0 + maxkey-protocol-saml-2.0 maxkey-core - maxkey-protocol-extendapi + maxkey-dao + maxkey-client-sdk + maxkey-authentications + maxkey-protocol-authorize maxkey-protocol-cas + maxkey-protocol-desktop + maxkey-protocol-extendapi + maxkey-protocol-formbased + maxkey-protocol-tokenbased diff --git a/maxkey-web-maxkey/src/main/resources/templates/views/passwordExpired.ftl b/maxkey-web-maxkey/src/main/resources/templates/views/passwordExpired.ftl index e1ff793e..67658540 100644 --- a/maxkey-web-maxkey/src/main/resources/templates/views/passwordExpired.ftl +++ b/maxkey-web-maxkey/src/main/resources/templates/views/passwordExpired.ftl @@ -40,13 +40,13 @@ diff --git a/maxkey-web-maxkey/src/main/resources/templates/views/passwordInitial.ftl b/maxkey-web-maxkey/src/main/resources/templates/views/passwordInitial.ftl index 566c3865..e6b6f97f 100644 --- a/maxkey-web-maxkey/src/main/resources/templates/views/passwordInitial.ftl +++ b/maxkey-web-maxkey/src/main/resources/templates/views/passwordInitial.ftl @@ -40,13 +40,13 @@ diff --git a/maxkey-web-maxkey/src/main/resources/templates/views/profile/myProfile.ftl b/maxkey-web-maxkey/src/main/resources/templates/views/profile/myProfile.ftl index 252b0f79..a73a1020 100644 --- a/maxkey-web-maxkey/src/main/resources/templates/views/profile/myProfile.ftl +++ b/maxkey-web-maxkey/src/main/resources/templates/views/profile/myProfile.ftl @@ -50,7 +50,7 @@ diff --git a/maxkey-web-maxkey/src/main/resources/templates/views/safe/changePassword.ftl b/maxkey-web-maxkey/src/main/resources/templates/views/safe/changePassword.ftl index bbdba044..63cfb12c 100644 --- a/maxkey-web-maxkey/src/main/resources/templates/views/safe/changePassword.ftl +++ b/maxkey-web-maxkey/src/main/resources/templates/views/safe/changePassword.ftl @@ -36,20 +36,20 @@ diff --git a/maxkey-web-maxkey/src/main/resources/templates/views/safe/setting.ftl b/maxkey-web-maxkey/src/main/resources/templates/views/safe/setting.ftl index 718b270f..1272f790 100644 --- a/maxkey-web-maxkey/src/main/resources/templates/views/safe/setting.ftl +++ b/maxkey-web-maxkey/src/main/resources/templates/views/safe/setting.ftl @@ -59,7 +59,7 @@ @@ -73,7 +73,7 @@
<@locale code="userinfo.id" /><@locale code="userinfo.username" /><@locale code="userinfo.username" /> <@locale code="userinfo.email" /> <@locale code="userinfo.windowsAccount" /> <@locale code="userinfo.employeeNumber" />
<@locale code="apps.tokenbased.expires" />: - + <@locale code="apps.isAdapter" />: diff --git a/maxkey-web-manage/src/main/resources/templates/views/apps/tokenbased/appUpdate.ftl b/maxkey-web-manage/src/main/resources/templates/views/apps/tokenbased/appUpdate.ftl index d049d974..e4923428 100644 --- a/maxkey-web-manage/src/main/resources/templates/views/apps/tokenbased/appUpdate.ftl +++ b/maxkey-web-manage/src/main/resources/templates/views/apps/tokenbased/appUpdate.ftl @@ -61,7 +61,7 @@ $(function(){
<@locale code="apps.tokenbased.redirectUri" />: - +
<@locale code="apps.tokenbased.expires" />: - + <@locale code="apps.isAdapter" />: diff --git a/maxkey-web-manage/src/main/resources/templates/views/groups/groupAdd.ftl b/maxkey-web-manage/src/main/resources/templates/views/groups/groupAdd.ftl index d26764c8..941e4d73 100644 --- a/maxkey-web-manage/src/main/resources/templates/views/groups/groupAdd.ftl +++ b/maxkey-web-manage/src/main/resources/templates/views/groups/groupAdd.ftl @@ -17,7 +17,7 @@
<@locale code="group.name" />: - +
<@locale code="group.name" />: - +
<@locale code="login.password.newPassword" />: - +
<@locale code="login.password.confirmPassword" />: - +
<@locale code="login.password.newPassword" />: - +
<@locale code="login.password.confirmPassword" />: - +
<@locale code="userinfo.displayName" />: - + <@locale code="userinfo.picture" />:
<@locale code="login.password.oldPassword" /> : - +
<@locale code="login.password.newPassword" />: - +
<@locale code="login.password.confirmPassword" />: - +
<@locale code="userinfo.mobile" /> : - +
<@locale code="userinfo.email" /> : - +