forked from animo/openid4vc-playground
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Berend Sliedrecht <[email protected]>
- Loading branch information
1 parent
ca57688
commit b34dcf7
Showing
3 changed files
with
7 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
if (!process.env.P256_SEED || !process.env.AGENT_HOST || !process.env.AGENT_WALLET_KEY) { | ||
if (!process.env.P256_SEED || !process.env.AGENT_HOST || !process.env.AGENT_WALLET_KEY || !process.env.AGENT_DNS) { | ||
throw new Error('P256_SEED, AGENT_HOST or AGENT_WALLET_KEY env variable not set') | ||
} | ||
|
||
const AGENT_HOST = process.env.AGENT_HOST | ||
const AGENT_DNS = process.env.AGENT_DNS | ||
const AGENT_WALLET_KEY = process.env.AGENT_WALLET_KEY | ||
|
||
const P256_SEED = process.env.P256_SEED | ||
const X509_CERTIFICATE = process.env.X509_CERTIFICATE | ||
|
||
export { AGENT_HOST, AGENT_WALLET_KEY, P256_SEED, X509_CERTIFICATE } | ||
export { AGENT_HOST, AGENT_WALLET_KEY, P256_SEED, X509_CERTIFICATE, AGENT_DNS } |
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,13 +1,13 @@ | ||
import { type Key, X509Service } from '@credo-ts/core' | ||
import { agent } from '../agent' | ||
import { AGENT_HOST } from '../constants' | ||
import { AGENT_DNS } from '../constants' | ||
|
||
export const createSelfSignedCertificate = async (key: Key) => | ||
( | ||
await X509Service.createSelfSignedCertificate(agent.context, { | ||
key, | ||
extensions: [[{ type: 'url', value: AGENT_HOST }]], | ||
extensions: [[{ type: 'dns', value: AGENT_DNS }]], | ||
notBefore: new Date(0), // Thu Jan 01 1970 01:00:00 GMT+0100 (Central European Standard Time) | ||
notAfter: new Date(10000000000000), // Sat Nov 20 2286 18:46:40 GMT+0100 (Central European Standard Time) | ||
notAfter: new Date(1763799732333), // Sat Nov 22 2025 09:22:12 GMT+0100 (Central European Standard Time) | ||
}) | ||
).toString('base64') |
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