Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Verify Signer Using Parent Key #290

Open
a4smanjorg5 opened this issue Jun 27, 2024 · 0 comments
Open

Verify Signer Using Parent Key #290

a4smanjorg5 opened this issue Jun 27, 2024 · 0 comments

Comments

@a4smanjorg5
Copy link

a4smanjorg5 commented Jun 27, 2024

Can the signer (signer = private key) come from a sub-private key and verify from the parent public key? A case in point is openssl which can create a certificate chain. So, since openssl also has a CRL, it can revoke the certificate chain where subsequent signings cannot be verified.

Here is the code snippet

...
    async open(args?: any): Promise<void> {
        await this.posts.open({
            type: Post,
            canPerform: (properties) => {
                // This canPerfom will only return true if the post was signed by REQUIRED_SIGNER and another party
                const publicKeys = properties.entry.publicKeys; // Public keys of signers
                if (
                    publicKeys.find((publicKey) =>
                        publicKey.equals(REQUIRED_SIGNER.publicKey) // <-- There may be additional codes to search for parental certificates such as self-signed certificates
                    ) &&
                    publicKeys.find(
                        (publicKey) => !publicKey.equals(REQUIRED_SIGNER.publicKey)
                    )
                ) {
                    return true;
                }

                return false;
            }
        });
    }
}
...

await db.posts.put(new Post("Hello world!"), {
    signers: [
        REQUIRED_SIGNER.sign.bind(REQUIRED_SIGNER) // <-- here using a private sub-key. But if it is revoked then the subsequent signing of the same signer cannot be verified.
    ]
});

...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant