-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
39 changed files
with
186 additions
and
218 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<artifactId>dev-cheat-sheet</artifactId> | ||
<groupId>lin.louis</groupId> | ||
<version>${revision}</version> | ||
</parent> | ||
|
||
<artifactId>security</artifactId> | ||
|
||
<properties> | ||
<bouncycastle.jdk15on.version>1.69</bouncycastle.jdk15on.version> | ||
<junit.version>5.10.2</junit.version> | ||
<logback.version>1.5.6</logback.version> | ||
<lombok.version>1.18.32</lombok.version> | ||
</properties> | ||
|
||
<dependencyManagement> | ||
<dependencies> | ||
<dependency> | ||
<groupId>org.junit</groupId> | ||
<artifactId>junit-bom</artifactId> | ||
<version>${junit.version}</version> | ||
<type>pom</type> | ||
<scope>import</scope> | ||
</dependency> | ||
</dependencies> | ||
</dependencyManagement> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.bouncycastle</groupId> | ||
<artifactId>bcprov-ext-jdk15on</artifactId> | ||
<version>${bouncycastle.jdk15on.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.projectlombok</groupId> | ||
<artifactId>lombok</artifactId> | ||
<version>${lombok.version}</version> | ||
<scope>provided</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>ch.qos.logback</groupId> | ||
<artifactId>logback-classic</artifactId> | ||
<version>${logback.version}</version> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.junit.jupiter</groupId> | ||
<artifactId>junit-jupiter</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
</project> |
2 changes: 1 addition & 1 deletion
2
...in/louis/encryption/AESCipherBuilder.java → ...security/encryption/AESCipherBuilder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
.../louis/encryption/AESStreamDecryptor.java → ...curity/encryption/AESStreamDecryptor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
.../louis/encryption/AESStreamEncryptor.java → ...curity/encryption/AESStreamEncryptor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
.../test/java/lin/louis/encryption/Salt.java → ...a/lin/louis/security/encryption/Salt.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ash/ChainedMessageDigestInputStreams.java → ...ash/ChainedMessageDigestInputStreams.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
.../louis/hash/MessageDigestInputStream.java → ...curity/hash/MessageDigestInputStream.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...est/java/lin/louis/password/Password.java → ...lin/louis/security/password/Password.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package lin.louis.password; | ||
package lin.louis.security.password; | ||
|
||
import java.util.Arrays; | ||
|
||
|
2 changes: 1 addition & 1 deletion
2
...a/lin/louis/password/PasswordBuilder.java → ...is/security/password/PasswordBuilder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 4 additions & 4 deletions
8
...a/lin/louis/password/PasswordFactory.java → ...is/security/password/PasswordFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ava/lin/louis/password/SaltGenerator.java → ...ouis/security/password/SaltGenerator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
.../password/plain/PlainPasswordBuilder.java → .../password/plain/PlainPasswordBuilder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
...assword/scrypt/SCryptPasswordBuilder.java → ...assword/scrypt/SCryptPasswordBuilder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 6 additions & 10 deletions
16
...assword/sha256/Sha256PasswordBuilder.java → ...assword/sha256/Sha256PasswordBuilder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...rc/test/java/lin/louis/sign/HashAlgo.java → ...ava/lin/louis/security/sign/HashAlgo.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package lin.louis.sign; | ||
package lin.louis.security.sign; | ||
|
||
public enum HashAlgo { | ||
SHA256("SHA-256"); | ||
|
11 changes: 5 additions & 6 deletions
11
...st/java/lin/louis/sign/TestFactories.java → ...in/louis/security/sign/TestFactories.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 1 addition & 5 deletions
6
...java/lin/louis/sign/X509Certificates.java → ...louis/security/sign/X509Certificates.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,6 @@ | ||
package lin.louis.sign; | ||
package lin.louis.security.sign; | ||
|
||
public class X509Certificates { | ||
// Content between the -----BEGIN RSA CERTIFICATE----- and -----END RSA CERTIFICATE----- of the private part of the certificate | ||
// of the file https://github.com/l-lin/dev-cheat-sheet/blob/master/java/tomcat-sample-cert-auth/foobar/certificate/foobarCA.key | ||
public static final String PRIVATE_KEY = "MIICXQIBAAKBgQDWCOCt8f72/PE4dfEhaDZY6bjue3MFu7LbSOr3dTGHrPXlgAA6j+ATct6Rb8eBcxvPhqKGwv0Ho+dygT78K6xZmze7n27aY3Dln2MS9f9uS7AoElQRQxgqmuXPS1VRi3YBOdqk4z2D/+cH0/FACUFpGc5fuECIWFiugK/IhgWkGQIDAQABAoGANG1GQ7VUI8G/gHn7T5iMP2k4oEni2dOpMueAjo7JTBeEv+uDotSdKYZomC1OLBo7BLFQ3Duk6Rsv1S9tcy1rcLDIhyxLjkX7SbU7pRQmsiTMKbxoyP0Fck0TORp9M6I+u22LrokJ10/KMcV5dg9e5wRiqSvKTVaTzqA33VAke1ECQQDw8Jtc1M5nCDRP5k+gCwTnuXYV9yuAw+nNy/hinRMdJafXcjy0hfDG6jKKSIv6ulobKlrbQ8YIC+4WAQtok9YFAkEA42m/ftrAWxw7GgrxbSVA0CDiCpyBIrDil8f606H2tZeG0EAPL45o668AgoXdvs7pDUDh6nBwE3WCZdOp9lx+BQJBAMPu9nj8eckhy+C560C8FUYX9OaR9Semqkh4Ocp/795BFAfJV4J6db5dD7KSonrH9qSmwfITYESE5x2vxcZKir0CQQCcqO2VWuamHSWNxDoaoU4r0mtFOhkvp8EBJG9jOTD2WcMyVN7hOO6IZY8pW0StvGYJjkfTM8/RZ+MDeLOeFottAkAxMWFGB+HwF5NZdNzwq9Q4DLu/geI/H9HBejAigHnNUfTInFWxlJOoGQuHwTmjf1G48NicXya8IsLsPgBvHs8w"; | ||
// Content between the -----BEGIN CERTIFICATE----- and -----END CERTIFICATE----- of the private part of the certificate | ||
// of the file https://github.com/l-lin/dev-cheat-sheet/blob/master/java/tomcat-sample-cert-auth/foobar/certificate/foobarCA.crt | ||
public static final String PUBLIC_KEY = "MIICdDCCAd2gAwIBAgIJAIjyT+oKZ7UKMA0GCSqGSIb3DQEBBQUAMFMxCzAJBgNVBAYTAkZSMQwwCgYDVQQIDANJREYxDjAMBgNVBAcMBVBhcmlzMREwDwYDVQQKDAhGb29iYXJDQTETMBEGA1UEAwwKKi5sb2NhbC5mcjAeFw0xNDA4MTQxNjE3MjlaFw0yNDA4MTExNjE3MjlaMFMxCzAJBgNVBAYTAkZSMQwwCgYDVQQIDANJREYxDjAMBgNVBAcMBVBhcmlzMREwDwYDVQQKDAhGb29iYXJDQTETMBEGA1UEAwwKKi5sb2NhbC5mcjCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA1gjgrfH+9vzxOHXxIWg2WOm47ntzBbuy20jq93Uxh6z15YAAOo/gE3LekW/HgXMbz4aihsL9B6PncoE+/CusWZs3u59u2mNw5Z9jEvX/bkuwKBJUEUMYKprlz0tVUYt2ATnapOM9g//nB9PxQAlBaRnOX7hAiFhYroCvyIYFpBkCAwEAAaNQME4wHQYDVR0OBBYEFDttawgSlrgwwc92/asJh/JfL2bzMB8GA1UdIwQYMBaAFDttawgSlrgwwc92/asJh/JfL2bzMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQADgYEArrGXPUJ11XnjsRAjG3L8hQS/ncnK1wFD6uVJTIntt8jHSCe7VyRkdYtskBgvHmaW7v6YOmaZ5KpN4Ii7cH+Lf4OEXO76IDFBWfknplp54+io+qbgGDTjZoQyiw25QbQgJQbDeKJUpQ8d0cdO05XXgv9eIy6lvD9iHc+UxJOtktA="; | ||
} |
4 changes: 2 additions & 2 deletions
4
...st/java/lin/louis/sign/signer/Signer.java → ...in/louis/security/sign/signer/Signer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.