Skip to content

Some tests are doing validation of privateNodeRSA objects instead of publicNodeRSA #141

Closed
@enver

Description

@enver

There are 3 tests that validate privateNodeRSA object when instead they should validate publicNodeRSA.

it('should gracefully handle data outside of encapsulation boundaries for pkcs8 public keys', function () {
    let publicFileWithNoise = 'Lorem ipsum' + fs.readFileSync(keysFolder + 'public_pkcs8.pem') + 'dulce et decorum';
    let publicNodeRSA = new NodeRSA(publicFileWithNoise);
    assert.instanceOf(privateNodeRSA.keyPair, Object);  <== It should be publicNodeRSA
    assert(publicNodeRSA.isPublic());
    assert(publicNodeRSA.isPublic(true));
    assert(!publicNodeRSA.isPrivate());
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions