You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/client/README.md
+33-35
Original file line number
Diff line number
Diff line change
@@ -6,9 +6,9 @@ and verify any file.
6
6
7
7
## Features
8
8
9
-
* Support for signing using an OpenID Connect identity
10
-
* Support for publishing signatures to a [Rekor][1] instance
11
-
* Support for verifying Sigstore bundles
9
+
- Support for signing using an OpenID Connect identity
10
+
- Support for publishing signatures to a [Rekor][1] instance
11
+
- Support for verifying Sigstore bundles
12
12
13
13
## Prerequisites
14
14
@@ -140,11 +140,11 @@ library. It also lists which `sigstore` versions were shipped with different
140
140
## Usage
141
141
142
142
```javascript
143
-
const { sigstore} =require('sigstore')
143
+
const { attest, verify} =require('sigstore');
144
144
```
145
145
146
146
```javascript
147
-
import { sigstore} from'sigstore'
147
+
import { attest, verify} from'sigstore';
148
148
```
149
149
150
150
### sign(payload[, options])
@@ -153,47 +153,46 @@ Generates a Sigstore signature for the supplied payload. Returns a
153
153
[Sigstore bundle][2] containing the signature and the verification material
154
154
necessary to verify the signature.
155
155
156
-
*`payload``<Buffer>`: The bytes of the artifact to be signed.
157
-
*`options``<Object>`
158
-
*`fulcioURL``<string>`: The base URL of the Fulcio instance to use for retrieving the signing certificate. Defaults to `'https://fulcio.sigstore.dev'`.
159
-
*`rekorURL``<string>`: The base URL of the Rekor instance to use when adding the signature to the transparency log. Defaults to `'https://rekor.sigstore.dev'`.
160
-
*`tsaServerURL``<string>`: The base URL of the Timestamp Authority instance to use when requesting a signed timestamp. If omitted, no timestamp will be requested.
161
-
*`tlogUpload``<boolean>`: Flag indicating whether or not the signature should be recorded on the Rekor transparency log. Defaults to `true`.
162
-
*`identityToken``<string>`: The OIDC token identifying the signer. If no explicit token is supplied, an attempt will be made to retrieve one from the environment. This config cannot be used with `identityProvider`.
163
-
*`identityProvider``<IdentityProvider>`: Object which implements `getToken: () => Promise<string>`. The supplied provider will be used to retrieve an OIDC token. If no provider is supplied, an attempt will be made to retrieve an OIDC token from the environment. This config cannot be used with `identityToken`.
156
+
-`payload``<Buffer>`: The bytes of the artifact to be signed.
157
+
-`options``<Object>`
158
+
-`fulcioURL``<string>`: The base URL of the Fulcio instance to use for retrieving the signing certificate. Defaults to `'https://fulcio.sigstore.dev'`.
159
+
-`rekorURL``<string>`: The base URL of the Rekor instance to use when adding the signature to the transparency log. Defaults to `'https://rekor.sigstore.dev'`.
160
+
-`tsaServerURL``<string>`: The base URL of the Timestamp Authority instance to use when requesting a signed timestamp. If omitted, no timestamp will be requested.
161
+
-`tlogUpload``<boolean>`: Flag indicating whether or not the signature should be recorded on the Rekor transparency log. Defaults to `true`.
162
+
-`identityToken``<string>`: The OIDC token identifying the signer. If no explicit token is supplied, an attempt will be made to retrieve one from the environment. This config cannot be used with `identityProvider`.
163
+
-`identityProvider``<IdentityProvider>`: Object which implements `getToken: () => Promise<string>`. The supplied provider will be used to retrieve an OIDC token. If no provider is supplied, an attempt will be made to retrieve an OIDC token from the environment. This config cannot be used with `identityToken`.
164
164
165
165
### attest(payload, payloadType[, options])
166
166
167
167
Generates a Sigstore signature for the supplied in-toto statement. Returns a
168
168
[Sigstore bundle][2] containing the [DSSE][3]-wrapped statement and signature
169
169
as well as the verification material necessary to verify the signature.
170
170
171
-
*`payload``<Buffer>`: The bytes of the statement to be signed.
172
-
*`payloadType``<string>`: MIME or content type describing the statement to be signed.
173
-
*`options``<Object>`
174
-
*`fulcioURL``<string>`: The base URL of the Fulcio instance to use for retrieving the signing certificate. Defaults to `'https://fulcio.sigstore.dev'`.
175
-
*`rekorURL``<string>`: The base URL of the Rekor instance to use when adding the signature to the transparency log. Defaults to `'https://rekor.sigstore.dev'`.
176
-
*`tsaServerURL``<string>`: The base URL of the Timestamp Authority instance to use when requesting a signed timestamp. If omitted, no timestamp will be requested.
177
-
*`tlogUpload``<boolean>`: Flag indicating whether or not the signed statement should be recorded on the Rekor transparency log. Defaults to `true`.
178
-
*`identityToken``<string>`: The OIDC token identifying the signer. If no explicit token is supplied, an attempt will be made to retrieve one from the environment. This config cannot be used with `identityProvider`.
179
-
*`identityProvider``<IdentityProvider>`: Object which implements `getToken: () => Promise<string>`. The supplied provider will be used to retrieve an OIDC token. If no provider is supplied, an attempt will be made to retrieve an OIDC token from the environment. This config cannot be used with `identityToken`.
180
-
171
+
-`payload``<Buffer>`: The bytes of the statement to be signed.
172
+
-`payloadType``<string>`: MIME or content type describing the statement to be signed.
173
+
-`options``<Object>`
174
+
-`fulcioURL``<string>`: The base URL of the Fulcio instance to use for retrieving the signing certificate. Defaults to `'https://fulcio.sigstore.dev'`.
175
+
-`rekorURL``<string>`: The base URL of the Rekor instance to use when adding the signature to the transparency log. Defaults to `'https://rekor.sigstore.dev'`.
176
+
-`tsaServerURL``<string>`: The base URL of the Timestamp Authority instance to use when requesting a signed timestamp. If omitted, no timestamp will be requested.
177
+
-`tlogUpload``<boolean>`: Flag indicating whether or not the signed statement should be recorded on the Rekor transparency log. Defaults to `true`.
178
+
-`identityToken``<string>`: The OIDC token identifying the signer. If no explicit token is supplied, an attempt will be made to retrieve one from the environment. This config cannot be used with `identityProvider`.
179
+
-`identityProvider``<IdentityProvider>`: Object which implements `getToken: () => Promise<string>`. The supplied provider will be used to retrieve an OIDC token. If no provider is supplied, an attempt will be made to retrieve an OIDC token from the environment. This config cannot be used with `identityToken`.
181
180
182
181
### verify(bundle[, payload][, options])
183
182
184
183
Verifies the signature in the supplied bundle.
185
184
186
-
*`bundle``<Bundle>`: The Sigstore bundle containing the signature to be verified and the verification material necessary to verify the signature.
187
-
*`payload``<Buffer>`: The bytes of the artifact over which the signature was created. Only necessary when the `sign` function was used to generate the signature since the Bundle does not contain any information about the artifact which was signed. Not required when the `attest` function was used to generate the Bundle.
188
-
*`options``<Object>`
189
-
*`ctLogThreshold``<number>`: The number of certificate transparency logs on which the signing certificate must appear. Defaults to `1`.
190
-
*`tlogThreshold``<number>`: The number of transparency logs on which the signature must appear. Defaults to `1`.
191
-
*`certificateIssuer``<string>`: Value that must appear in the signing certificate's issuer extension (OID 1.3.6.1.4.1.57264.1.1). Not verified if no value is supplied.
192
-
*`certificateIdentityEmail``<string>`: Email address which must appear in the signing certificate's Subject Alternative Name (SAN) extension. Must be specified in conjunction with the `certificateIssuer` option. Takes precedence over the `certificateIdentityURI` option. Not verified if no value is supplied.
193
-
*`certificateIdentityURI``<string>`: URI which must appear in the signing certificate's Subject Alternative Name (SAN) extension. Must be specified in conjunction with the `certificateIssuer` option. Ignored if the `certificateIdentityEmail` option is set. Not verified if no value is supplied.
194
-
*`certificateOIDs``<Object>`: A collection of OID/value pairs which must be present in the certificate's extension list. Not verified if no value is supplied.
195
-
*`keySelector``<Function>`: Callback invoked to retrieve the public key (as either `string` or `Buffer`) necessary to verify the bundle signature. Not used when the signature was generated from a Fulcio-issued signing certificate.
196
-
*`hint``<String>`: The hint from the bundle used to identify the the signing key.
185
+
-`bundle``<Bundle>`: The Sigstore bundle containing the signature to be verified and the verification material necessary to verify the signature.
186
+
-`payload``<Buffer>`: The bytes of the artifact over which the signature was created. Only necessary when the `sign` function was used to generate the signature since the Bundle does not contain any information about the artifact which was signed. Not required when the `attest` function was used to generate the Bundle.
187
+
-`options``<Object>`
188
+
-`ctLogThreshold``<number>`: The number of certificate transparency logs on which the signing certificate must appear. Defaults to `1`.
189
+
-`tlogThreshold``<number>`: The number of transparency logs on which the signature must appear. Defaults to `1`.
190
+
-`certificateIssuer``<string>`: Value that must appear in the signing certificate's issuer extension (OID 1.3.6.1.4.1.57264.1.1). Not verified if no value is supplied.
191
+
-`certificateIdentityEmail``<string>`: Email address which must appear in the signing certificate's Subject Alternative Name (SAN) extension. Must be specified in conjunction with the `certificateIssuer` option. Takes precedence over the `certificateIdentityURI` option. Not verified if no value is supplied.
192
+
-`certificateIdentityURI``<string>`: URI which must appear in the signing certificate's Subject Alternative Name (SAN) extension. Must be specified in conjunction with the `certificateIssuer` option. Ignored if the `certificateIdentityEmail` option is set. Not verified if no value is supplied.
193
+
-`certificateOIDs``<Object>`: A collection of OID/value pairs which must be present in the certificate's extension list. Not verified if no value is supplied.
194
+
-`keySelector``<Function>`: Callback invoked to retrieve the public key (as either `string` or `Buffer`) necessary to verify the bundle signature. Not used when the signature was generated from a Fulcio-issued signing certificate.
195
+
-`hint``<String>`: The hint from the bundle used to identify the the signing key.
197
196
198
197
## Credential Sources
199
198
@@ -212,7 +211,6 @@ for more details.
212
211
If the `SIGSTORE_ID_TOKEN` environment variable is set, it will use this to authenticate to Fulcio.
213
212
It is the callers responsibility to make sure that this token has the correct scopes.
0 commit comments