Skip to content

Commit 325e782

Browse files
authored
Merge pull request #12 from patrickfav/feature/github-actions
2 parents 8c44692 + ee6125b commit 325e782

File tree

4 files changed

+100
-16
lines changed

4 files changed

+100
-16
lines changed

.github/workflows/build_deploy.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Build and Deploy with Maven
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
tags:
8+
- '*' # Trigger on all tags
9+
pull_request: { }
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout Code
17+
uses: actions/checkout@v3
18+
- name: Set up JDK 8
19+
uses: actions/setup-java@v3
20+
with:
21+
java-version: '11'
22+
distribution: 'adopt'
23+
cache: 'maven'
24+
- name: Build with Maven
25+
run: ./mvnw -B clean package checkstyle:checkstyle jacoco:report -DcommonConfig.jarSign.skip=true
26+
- name: Upload coverage reports to CodeCov
27+
uses: codecov/codecov-action@v3
28+
29+
deploy:
30+
needs: build
31+
if: startsWith(github.ref, 'refs/tags/')
32+
runs-on: ubuntu-latest
33+
34+
steps:
35+
- uses: actions/checkout@v3
36+
- name: Retrieve Keystore from secrets
37+
env:
38+
KEYSTORE_BASE64: ${{ secrets.KEYSTORE_BASE64 }}
39+
run: |
40+
echo $KEYSTORE_BASE64 | base64 --decode > keystore.jks
41+
- name: Set up Maven Central Repository
42+
uses: actions/setup-java@v3
43+
with:
44+
java-version: '11'
45+
distribution: 'adopt'
46+
cache: 'maven'
47+
server-id: ossrh
48+
server-username: MAVEN_USERNAME
49+
server-password: MAVEN_PASSWORD
50+
- name: Publish package
51+
run: mvn -B deploy -DskipTests
52+
env:
53+
OPENSOURCE_PROJECTS_KS_PW: ${{ secrets.KEYSTORE_PASSWORD }}
54+
OPENSOURCE_PROJECTS_KEY_PW: ${{ secrets.KEYSTORE_KEY_PASSWORD }}
55+
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
56+
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
57+
- name: Create and upload Github Release
58+
uses: xresloader/upload-to-github-release@v1
59+
env:
60+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
61+
with:
62+
file: "target/hkdf-*.jar;target/*.sha256;target/checksum-sha256.txt"
63+
tags: true
64+
draft: false

README.md

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,25 @@
11
# HMAC-based Key Derivation Function (HKDF) RFC 5869
22

3-
[Hashed Message Authentication Code](https://en.wikipedia.org/wiki/Hash-based_message_authentication_code) (HMAC)-based key derivation function ([HKDF](https://en.wikipedia.org/wiki/HKDF)), can be used as a building block in various protocols and applications. The [key derivation function](https://en.wikipedia.org/wiki/Key_derivation_function) (KDF) is intended to support a wide range of applications and requirements, and is conservative in its use of [cryptographic hash functions](https://en.wikipedia.org/wiki/Cryptographic_hash_function). It is likely to have [better security properties](https://crypto.stackexchange.com/questions/13232/how-is-hkdf-expand-better-than-a-simple-hash) than KDF's based on just a hash functions alone. See [RFC 5869](https://tools.ietf.org/html/rfc5869) for full detail. HKDF specifies a version of the [NIST Special Publication 800-56C](https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-56Cr1.pdf) "Two-Step Key Derivation" scheme.
3+
[Hashed Message Authentication Code](https://en.wikipedia.org/wiki/Hash-based_message_authentication_code) (HMAC)-based
4+
key derivation function ([HKDF](https://en.wikipedia.org/wiki/HKDF)), can be used as a building block in various
5+
protocols and applications. The [key derivation function](https://en.wikipedia.org/wiki/Key_derivation_function) (KDF)
6+
is intended to support a wide range of applications and requirements, and is conservative in its use
7+
of [cryptographic hash functions](https://en.wikipedia.org/wiki/Cryptographic_hash_function). It is likely to
8+
have [better security properties](https://crypto.stackexchange.com/questions/13232/how-is-hkdf-expand-better-than-a-simple-hash)
9+
than KDF's based on just a hash functions alone. See [RFC 5869](https://tools.ietf.org/html/rfc5869) for full detail.
10+
HKDF specifies a version of
11+
the [NIST Special Publication 800-56C](https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-56Cr1.pdf) "
12+
Two-Step Key Derivation" scheme.
413

514
[![Download](https://api.bintray.com/packages/patrickfav/maven/hkdf/images/download.svg)](https://bintray.com/patrickfav/maven/hkdf/_latestVersion)
615
[![Build Status](https://travis-ci.com/patrickfav/hkdf.svg?branch=master)](https://travis-ci.com/patrickfav/hkdf)
716
[![Javadocs](https://www.javadoc.io/badge/at.favre.lib/hkdf.svg)](https://www.javadoc.io/doc/at.favre.lib/hkdf)
8-
[![Coverage Status](https://coveralls.io/repos/github/patrickfav/hkdf/badge.svg?branch=master)](https://coveralls.io/github/patrickfav/hkdf?branch=master) [![Maintainability](https://api.codeclimate.com/v1/badges/fc50d911e4146a570d4e/maintainability)](https://codeclimate.com/github/patrickfav/hkdf/maintainability)
17+
[![codecov](https://codecov.io/gh/patrickfav/bcrypt/branch/master/graph/badge.svg?token=HP8FL3ZJG7)](https://codecov.io/gh/patrickfav/bcrypt) [![Maintainability](https://api.codeclimate.com/v1/badges/fc50d911e4146a570d4e/maintainability)](https://codeclimate.com/github/patrickfav/hkdf/maintainability)
918

10-
This is a standalone, lightweight, simple to use, fully tested and stable implementation in Java. The code is compiled with target [Java 7](https://en.wikipedia.org/wiki/Java_version_history#Java_SE_7) to be compatible with most [_Android_](https://www.android.com/) versions as well as normal Java applications. It passes all test vectors from [RFC 5869 Appendix A.](https://tools.ietf.org/html/rfc5869#appendix-A)
19+
This is a standalone, lightweight, simple to use, fully tested and stable implementation in Java. The code is compiled
20+
with target [Java 7](https://en.wikipedia.org/wiki/Java_version_history#Java_SE_7) to be compatible with most [
21+
_Android_](https://www.android.com/) versions as well as normal Java applications. It passes all test vectors
22+
from [RFC 5869 Appendix A.](https://tools.ietf.org/html/rfc5869#appendix-A)
1123

1224
## Quickstart
1325

pom.xml

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
</parent>
1212

1313
<artifactId>hkdf</artifactId>
14-
<version>1.1.0</version>
14+
<version>2.0.0</version>
1515
<packaging>jar</packaging>
1616

1717
<name>HKDF-RFC5869</name>
@@ -25,15 +25,26 @@
2525

2626
<repositories>
2727
<repository>
28-
<id>jcenter</id>
29-
<name>jcenter</name>
30-
<url>https://jcenter.bintray.com</url>
28+
<id>central</id>
29+
<name>Maven Central</name>
30+
<url>https://repo1.maven.org/maven2</url>
3131
<snapshots>
3232
<enabled>false</enabled>
3333
</snapshots>
3434
</repository>
3535
</repositories>
3636

37+
<pluginRepositories>
38+
<pluginRepository>
39+
<id>central</id>
40+
<name>Maven Central</name>
41+
<url>https://repo1.maven.org/maven2</url>
42+
<snapshots>
43+
<enabled>false</enabled>
44+
</snapshots>
45+
</pluginRepository>
46+
</pluginRepositories>
47+
3748
<build>
3849
<plugins>
3950
<plugin>
@@ -94,10 +105,6 @@
94105
<groupId>org.jacoco</groupId>
95106
<artifactId>jacoco-maven-plugin</artifactId>
96107
</plugin>
97-
<plugin>
98-
<groupId>org.eluder.coveralls</groupId>
99-
<artifactId>coveralls-maven-plugin</artifactId>
100-
</plugin>
101108
<plugin>
102109
<groupId>org.apache.maven.plugins</groupId>
103110
<artifactId>maven-jarsigner-plugin</artifactId>
@@ -114,18 +121,19 @@
114121
<dependency>
115122
<groupId>junit</groupId>
116123
<artifactId>junit</artifactId>
124+
<version>4.13.2</version>
117125
<scope>test</scope>
118126
</dependency>
119127
<dependency>
120128
<groupId>org.apache.commons</groupId>
121129
<artifactId>commons-lang3</artifactId>
122-
<version>3.8.1</version>
130+
<version>3.12.0</version>
123131
<scope>test</scope>
124132
</dependency>
125133
<dependency>
126134
<groupId>commons-codec</groupId>
127135
<artifactId>commons-codec</artifactId>
128-
<version>1.11</version>
136+
<version>1.15</version>
129137
<scope>test</scope>
130138
</dependency>
131139
<dependency>
@@ -137,9 +145,9 @@
137145

138146
<distributionManagement>
139147
<repository>
140-
<id>bintray-patrickfav</id>
141-
<name>patrickfav-hkdf</name>
142-
<url>https://api.bintray.com/maven/patrickfav/maven/hkdf/;publish=1</url>
148+
<id>ossrh</id>
149+
<name>Central Repository OSSRH</name>
150+
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
143151
</repository>
144152
</distributionManagement>
145153

secrets.tar.enc

-6.52 KB
Binary file not shown.

0 commit comments

Comments
 (0)