I am making a IEEE1609.2 certificate via BouncyCastle in Java. toBeSignCertificate, which is the type of "org.bouncycastle.oer.its.ieee1609dot2.ToBeSignedCertificate" has already completed. Now I need to encode it to OER (IEEE1609.2 indicates that it should be encoded to OER). The problems I meet are as following.
Following is a function in class "OEREncoder" in package "org.bouncycastle.oer". It seems to be a function transfering objects to OER code. The first paramerter probably should be filled in with my toBeSignCertificate object, but I have no idea with the second parameter. I guess it is the definition of ASN1 encoding rules, but it seems to be stupid that I use bouncyCastle and I still need to deal with this trivial work.
public static byte[] toByteArray(org.bouncycastle.asn1.ASN1Encodable encodable, Element oerElement)
Is there anyone knows about the second paramerter? Or is there any alternative to encode my toBeSignCertificate to OER form?
Here is the document mentioned above: https://www.bouncycastle.org/docs/utildocs1.8on/org/bouncycastle/oer/OEREncoder.html
I have taken a look into definition about the sencond parameter "Element". It is likely to ask me to define the ASN1 encoding rule, but it is not reasonable at all. If I need to define the ASN1 enocoding rule on my own, then what is the use of BouncyCastle?