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

AsnConvert.serialize & primitive values #61

Open
ghost opened this issue Dec 14, 2021 · 0 comments
Open

AsnConvert.serialize & primitive values #61

ghost opened this issue Dec 14, 2021 · 0 comments

Comments

@ghost
Copy link

ghost commented Dec 14, 2021

For example if I want to serialize a BasicOCSPResponse which in turn has a ResponseData that has the attribute producedAt: Date

This snippet fails with Error: Cannot get schema for 'Object' target

AsnConvert.serialize(
  new OCSPResponse({
    responseStatus: OCSPResponseStatus.successful,
    responseBytes: new ResponseBytes({
      response: new OctetString(
        AsnConvert.serialize(
          new BasicOCSPResponse({
            tbsResponseData: {
              producedAt: new Date(),
              responses: [],
              responderID: new ResponderID(),
              version: Version.v1,
              responseExtensions: [
                {
                  critical: false,
                  extnID: id_pkix_ocsp_nonce,
                  extnValue: new OctetString(Convert.FromHex("FFF")),
                },
              ],
            },
          })
        )
      ),
    }),
  })
);

Is there a workaround for this?

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

0 participants