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

org.bouncycastle.asn1.ASN1TaggedObject#getObject removed, How can i solve it? #1668

Closed
hw207165 opened this issue May 20, 2024 · 1 comment

Comments

@hw207165
Copy link

When we upgrade bouncycastle from 1.74 to 1.78,the function: org.bouncycastle.asn1.ASN1TaggedObject#getObject has been removed. can anyone give me some suggestions, use getBaseObject instead of?

e.g. code:
private static Optional findByTag(List authorizationList, int tag) {
for (ASN1Encodable entry : authorizationList) {
ASN1TaggedObject taggedEntry = (ASN1TaggedObject) entry;
if (taggedEntry.getTagNo() == tag) {
return Optional.of(taggedEntry.getObject());
}
}
return Optional.empty();
}

@peterdettman
Copy link
Collaborator

Probably getExplicitBaseObject, but if you could tell us what ASN.1 type (e.g. from a specification) you are working with, there might be better options.

You should probably also replace if (taggedEntry.getTagNo() == tag) with if (taggedEntry.hasContextTag(tag) because a tagged object can have one of four tag classes and you are probably expecting only one of them (CONTEXT_SPECIFIC).

@dghgit dghgit closed this as completed Sep 2, 2024
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

3 participants