-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
While this will allow anyone to inject a trustedRoot instead of using sigstore public good, its been primarily included to allow conformance to inject alt trusted roots Signed-off-by: Appu Goundan <[email protected]>
- Loading branch information
1 parent
8d2d442
commit a6ff3f3
Showing
36 changed files
with
88 additions
and
814 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
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
57 changes: 57 additions & 0 deletions
57
sigstore-java/src/main/java/dev/sigstore/TrustedRootProvider.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 |
---|---|---|
@@ -0,0 +1,57 @@ | ||
/* | ||
* Copyright 2023 The Sigstore Authors. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package dev.sigstore; | ||
|
||
import com.google.common.base.Preconditions; | ||
import com.google.protobuf.util.JsonFormat; | ||
import dev.sigstore.proto.trustroot.v1.TrustedRoot; | ||
import dev.sigstore.trustroot.SigstoreTrustedRoot; | ||
import dev.sigstore.tuf.SigstoreTufClient; | ||
import java.io.IOException; | ||
import java.nio.charset.StandardCharsets; | ||
import java.nio.file.Files; | ||
import java.nio.file.Path; | ||
import java.security.InvalidAlgorithmParameterException; | ||
import java.security.InvalidKeyException; | ||
import java.security.NoSuchAlgorithmException; | ||
import java.security.cert.CertificateException; | ||
import java.security.spec.InvalidKeySpecException; | ||
|
||
@FunctionalInterface | ||
public interface TrustedRootProvider { | ||
|
||
SigstoreTrustedRoot get() | ||
throws InvalidAlgorithmParameterException, CertificateException, InvalidKeySpecException, | ||
NoSuchAlgorithmException, IOException, InvalidKeyException; | ||
|
||
static TrustedRootProvider from(SigstoreTufClient tufClient) { | ||
Preconditions.checkNotNull(tufClient); | ||
return () -> { | ||
tufClient.update(); | ||
return tufClient.getSigstoreTrustedRoot(); | ||
}; | ||
} | ||
|
||
static TrustedRootProvider from(Path trustedRoot) { | ||
Preconditions.checkNotNull(trustedRoot); | ||
return () -> { | ||
var trustedRootBuilder = TrustedRoot.newBuilder(); | ||
JsonFormat.parser() | ||
.merge(Files.readString(trustedRoot, StandardCharsets.UTF_8), trustedRootBuilder); | ||
return SigstoreTrustedRoot.from(trustedRootBuilder.build()); | ||
}; | ||
} | ||
} |
68 changes: 0 additions & 68 deletions
68
sigstore-java/src/main/java/dev/sigstore/VerificationMaterial.java
This file was deleted.
Oops, something went wrong.
20 changes: 1 addition & 19 deletions
20
sigstore-java/src/main/resources/dev/sigstore/tuf/README.md
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,21 +1,3 @@ | ||
# TUF Store | ||
|
||
This resource is a temporary alternative to an actual TUF client. | ||
This is **not a permanent solution** and should not be treated as such. | ||
If the key changes, they will not automatically be reflected here | ||
and various signing/verification workflows will fail. | ||
|
||
We keep copies of the remote tuf repositories locally in | ||
1. Production from https://tuf-repo-cdn.sigstore.dev \ | ||
for interfacing with *.sigstore.dev | ||
|
||
2. Staging from https://tuf-repo-cdn.sigstage.dev \ | ||
for interfacing with *.sigstage.dev | ||
|
||
For this client to function we need the following keys | ||
1. CTFE public keys (`ctfe.pub`, `ctfe_*.pub`) \ | ||
the public key for the certificate transparency log | ||
2. Fulcio root cert (`fulcio_v1.crt.pem` or `fulcio.crt.pem`) \ | ||
the root certificate for fulcio issued certificates | ||
3. Rekor public key (`rekor.pub`) \ | ||
the public key for the rekor transparency log | ||
Seed roots for sigstore public good and staging. |
4 changes: 0 additions & 4 deletions
4
sigstore-java/src/main/resources/dev/sigstore/tuf/production/ctfe.pub
This file was deleted.
Oops, something went wrong.
4 changes: 0 additions & 4 deletions
4
sigstore-java/src/main/resources/dev/sigstore/tuf/production/ctfe_2022.pub
This file was deleted.
Oops, something went wrong.
13 changes: 0 additions & 13 deletions
13
sigstore-java/src/main/resources/dev/sigstore/tuf/production/fulcio_v1.crt.pem
This file was deleted.
Oops, something went wrong.
4 changes: 0 additions & 4 deletions
4
sigstore-java/src/main/resources/dev/sigstore/tuf/production/rekor.pub
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.