Skip to content

Commit

Permalink
style: remove scar tissue and unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
mirceanis committed Aug 31, 2021
1 parent ce823b9 commit c6b0594
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 52 deletions.
33 changes: 0 additions & 33 deletions packages/cli/src/migrations/SecretBox1588075773000.ts

This file was deleted.

3 changes: 0 additions & 3 deletions packages/cli/src/migrations/index.ts

This file was deleted.

3 changes: 0 additions & 3 deletions packages/data-store/src/entities/key.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ export class Key extends BaseEntity {
//@ts-ignore
publicKeyHex: string

// @Column({ nullable: true })
// privateKeyHex?: string

@Column({
type: 'simple-json',
nullable: true,
Expand Down
1 change: 0 additions & 1 deletion packages/data-store/src/identifier/did-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ export class DIDStore extends AbstractDIDStore {
const key = new Key()
key.kid = argsKey.kid
key.publicKeyHex = argsKey.publicKeyHex
// key.privateKeyHex = argsKey.privateKeyHex
key.kms = argsKey.kms
key.meta = argsKey.meta
identifier.keys.push(key)
Expand Down
7 changes: 0 additions & 7 deletions packages/data-store/src/identifier/key-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ export class KeyStore extends AbstractKeyStore {
async get({ kid }: { kid: string }): Promise<IKey> {
const key = await (await this.dbConnection).getRepository(Key).findOne(kid)
if (!key) throw Error('Key not found')
// if (this.secretBox && key.privateKeyHex) {
// key.privateKeyHex = await this.secretBox.decrypt(key.privateKeyHex)
// }
return key as IKey
}

Expand All @@ -32,10 +29,6 @@ export class KeyStore extends AbstractKeyStore {
async import(args: IKey) {
const key = new Key()
key.kid = args.kid
// key.privateKeyHex = args.privateKeyHex
// if (this.secretBox && key.privateKeyHex) {
// key.privateKeyHex = await this.secretBox.encrypt(key.privateKeyHex)
// }
key.publicKeyHex = args.publicKeyHex
key.type = args.type
key.kms = args.kms
Expand Down
10 changes: 5 additions & 5 deletions packages/kms-local/src/key-management-system.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ export class KeyManagementSystem extends AbstractKeyManagementSystem {
const wallet = new Wallet(privateKeyHex)

const signature = await wallet._signTypedData(msgDomain, msgTypes, msg)
//HEX encoded string
// HEX encoded string
return signature
}

Expand All @@ -201,7 +201,7 @@ export class KeyManagementSystem extends AbstractKeyManagementSystem {
private async eth_signMessage(privateKeyHex: string, rawMessageBytes: Uint8Array) {
const wallet = new Wallet(privateKeyHex)
const signature = await wallet.signMessage(rawMessageBytes)
//HEX encoded string, 0x prefixed
// HEX encoded string, 0x prefixed
return signature
}

Expand All @@ -220,7 +220,7 @@ export class KeyManagementSystem extends AbstractKeyManagementSystem {
}
}
const signedRawTransaction = await wallet.signTransaction(<TransactionRequest>tx)
//HEX encoded string, 0x prefixed
// HEX encoded string, 0x prefixed
return signedRawTransaction
}

Expand All @@ -230,7 +230,7 @@ export class KeyManagementSystem extends AbstractKeyManagementSystem {
private async signEdDSA(key: string, data: Uint8Array): Promise<string> {
const signer = EdDSASigner(key)
const signature = await signer(data)
//base64url encoded string
// base64url encoded string
return signature as string
}

Expand All @@ -244,7 +244,7 @@ export class KeyManagementSystem extends AbstractKeyManagementSystem {
): Promise<string> {
const signer = ES256KSigner(privateKeyHex, alg === 'ES256K-R')
const signature = await signer(data)
//base64url encoded string
// base64url encoded string
return signature as string
}

Expand Down

0 comments on commit c6b0594

Please sign in to comment.