GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — chore: Sync Private Master with Public Master (#73) · aws/aws-encryption-sdk-java@80dc9d0

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • .releaserc
  • CHANGELOG.md
  • README.md
  • codebuild/release
    • upload_artifacts.yml
    • version.yml
  • pom.xml
  • src/test/java/com/amazonaws/encryptionsdk/jce
    • KeyStoreProviderTest.java
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎.releaserc‎

Copy file name to clipboardExpand all lines: .releaserc
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
}],
5858
["@semantic-release/git", {
5959
"assets": ["./CHANGELOG.md", "./pom.xml", "./README.md"],
60-
"message": "AWS Encryption SDK ${nextRelease.version} Release -- $(date +%Y-%m-%d) \n\n${nextRelease.notes}"
60+
"message": "AWS Encryption SDK ${nextRelease.version} Release -- ${new Date().toISOString().slice(0, 10)} \n\n${nextRelease.notes}"
6161
}],
6262
],
6363
"repositoryUrl": "https://github.com/aws/aws-encryption-sdk-java",
Collapse file

‎CHANGELOG.md‎

Copy file name to clipboardExpand all lines: CHANGELOG.md
+99Lines changed: 99 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
Large diffs are not rendered by default.
Collapse file

‎README.md‎

Copy file name to clipboardExpand all lines: README.md
+1-1Lines changed: 1 addition & 1 deletion
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ You can get the latest release from Maven:
5858
<dependency>
5959
<groupId>com.amazonaws</groupId>
6060
<artifactId>aws-encryption-sdk-java</artifactId>
61-
<version>2.4.0</version>
61+
<version>2.4.1</version>
6262
</dependency>
6363
```
6464

Collapse file

‎codebuild/release/upload_artifacts.yml‎

Copy file name to clipboardExpand all lines: codebuild/release/upload_artifacts.yml
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,4 @@ phases:
4242
mvn org.apache.maven.plugins:maven-dependency-plugin:3.1.2:get \
4343
-DrepoUrl=https://aws.oss.sonatype.org \
4444
-Dartifact=com.amazonaws:aws-encryption-sdk-java:${VERSION}:jar:javadoc
45-
- gh release create v${VERSION} ~/.m2/repository/com/amazonaws/aws-encryption-sdk-java/${VERSION}/*.jar -d -F CHANGELOG.md -t "AWS Encryption SDK ${VERSION} Release -- $(date +%Y-%m-%d)"
45+
- gh release create v${VERSION} ~/.m2/repository/com/amazonaws/aws-encryption-sdk-java/${VERSION}/*.jar -d -F CHANGELOG.md -t "AWS Encryption SDK ${VERSION} Release -- $(date +'%Y-%m-%d')"
Collapse file

‎codebuild/release/version.yml‎

Copy file name to clipboardExpand all lines: codebuild/release/version.yml
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ env:
1212
phases:
1313
install:
1414
commands:
15+
- n 18
16+
- node -v
1517
- npm install --save-dev semantic-release
1618
- npm install @semantic-release/changelog -d
1719
- npm install @semantic-release/exec -d
1820
- npm install @semantic-release/git -d
1921
- npm install --save conventional-changelog
20-
runtime-versions:
21-
nodejs: 14
2222
pre_build:
2323
commands:
2424
- git config --global user.name "aws-crypto-tools-ci-bot"
Collapse file

‎pom.xml‎

Copy file name to clipboardExpand all lines: pom.xml
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
<groupId>com.amazonaws</groupId>
66
<artifactId>aws-encryption-sdk-java</artifactId>
7-
<version>2.4.0</version>
7+
<version>2.4.1</version>
88
<packaging>jar</packaging>
99

1010
<name>aws-encryption-sdk-java</name>
@@ -115,7 +115,7 @@
115115
<dependency>
116116
<groupId>org.apache.commons</groupId>
117117
<artifactId>commons-lang3</artifactId>
118-
<version>3.12.0</version>
118+
<version>3.13.0</version>
119119
</dependency>
120120
</dependencies>
121121

Collapse file

‎src/test/java/com/amazonaws/encryptionsdk/jce/KeyStoreProviderTest.java‎

Copy file name to clipboardExpand all lines: src/test/java/com/amazonaws/encryptionsdk/jce/KeyStoreProviderTest.java
+23-32Lines changed: 23 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -32,26 +32,18 @@
3232
import java.security.KeyStore.PasswordProtection;
3333
import java.security.KeyStoreException;
3434
import java.security.SecureRandom;
35+
import java.security.Security;
3536
import java.security.cert.Certificate;
3637
import java.security.cert.X509Certificate;
3738
import java.time.Instant;
3839
import java.time.temporal.ChronoUnit;
3940
import java.util.Date;
4041
import javax.crypto.spec.SecretKeySpec;
42+
import javax.security.auth.x500.X500Principal;
43+
import org.bouncycastle.jce.provider.BouncyCastleProvider;
44+
import org.bouncycastle.x509.X509V3CertificateGenerator;
4145
import org.junit.Before;
4246
import org.junit.Test;
43-
import sun.security.x509.AlgorithmId;
44-
import sun.security.x509.CertificateAlgorithmId;
45-
import sun.security.x509.CertificateSerialNumber;
46-
import sun.security.x509.CertificateValidity;
47-
import sun.security.x509.CertificateX509Key;
48-
import sun.security.x509.X500Name;
49-
import sun.security.x509.X509CertImpl;
50-
import sun.security.x509.X509CertInfo;
51-
52-
/* These internal sun classes are included solely for test purposes as
53-
this test cannot use BouncyCastle cert generation, as there are incompatibilities
54-
between how standard BC and FIPS BC perform cert generation. */
5547

5648
public class KeyStoreProviderTest {
5749
private static final SecureRandom RND = new SecureRandom();
@@ -72,6 +64,7 @@ public class KeyStoreProviderTest {
7264

7365
@Before
7466
public void setup() throws Exception {
67+
Security.addProvider(new BouncyCastleProvider());
7568
ks = KeyStore.getInstance(KeyStore.getDefaultType());
7669
ks.load(null, PASSWORD);
7770
}
@@ -286,26 +279,24 @@ private void addPublicEntry(final String alias) throws GeneralSecurityException,
286279
}
287280

288281
private X509Certificate generateCertificate(final KeyPair pair, final String alias)
289-
throws GeneralSecurityException, IOException {
290-
final X509CertInfo info = new X509CertInfo();
291-
final X500Name name = new X500Name("dc=" + alias);
292-
info.set(X509CertInfo.SERIAL_NUMBER, new CertificateSerialNumber(new BigInteger(256, RND)));
293-
info.set(X509CertInfo.SUBJECT, name);
294-
info.set(X509CertInfo.ISSUER, name);
295-
info.set(
296-
X509CertInfo.VALIDITY,
297-
new CertificateValidity(
298-
Date.from(Instant.now().minus(1, ChronoUnit.DAYS)),
299-
Date.from(Instant.now().plus(730, ChronoUnit.DAYS))));
300-
info.set(X509CertInfo.KEY, new CertificateX509Key(pair.getPublic()));
301-
info.set(
302-
X509CertInfo.ALGORITHM_ID,
303-
new CertificateAlgorithmId(new AlgorithmId(AlgorithmId.sha256WithRSAEncryption_oid)));
304-
305-
final X509CertImpl cert = new X509CertImpl(info);
306-
cert.sign(pair.getPrivate(), AlgorithmId.sha256WithRSAEncryption_oid.toString());
307-
308-
return cert;
282+
throws GeneralSecurityException {
283+
final X509Certificate certificate;
284+
285+
// Generate self-signed certificate
286+
final X509V3CertificateGenerator certGen = new X509V3CertificateGenerator();
287+
final X500Principal dnName = new X500Principal("dc=" + alias);
288+
289+
certGen.setSerialNumber(new BigInteger(256, new SecureRandom()));
290+
certGen.setIssuerDN(dnName);
291+
certGen.setNotBefore(Date.from(Instant.now().minus(1, ChronoUnit.DAYS)));
292+
certGen.setNotAfter(Date.from(Instant.now().plus(730, ChronoUnit.DAYS)));
293+
certGen.setSubjectDN(dnName);
294+
certGen.setPublicKey(pair.getPublic());
295+
certGen.setSignatureAlgorithm("SHA256WithRSA");
296+
297+
certificate = certGen.generate(pair.getPrivate());
298+
299+
return certificate;
309300
}
310301

311302
private void copyPublicPart(final KeyStore src, final KeyStore dst, final String alias)

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.