@@ -62,9 +62,10 @@ public TagValue(int tagIn, ArrayList<TagValue> listIn) {
6262 * for the key
6363 * This function assumes that we are encoding an EC Public key.d
6464 *
65- * @param oid - encoded Object Identifier
65+ * @param algorithm - encoded Object Identifier
6666 * @param keyBytes - encoded key bytes
6767 * @return - encoded SPKI
68+ * @throws CoseException - ASN encoding error.
6869 */
6970 public static byte [] EncodeSubjectPublicKeyInfo (byte [] algorithm , byte [] keyBytes ) throws CoseException
7071 {
@@ -96,8 +97,8 @@ public static byte[] EncodeSubjectPublicKeyInfo(byte[] algorithm, byte[] keyByte
9697 * @param oid - curve to use
9798 * @param keyBytes - bytes of the key
9899 * @param spki - optional SPKI
99- * @return
100- * @throws CoseException
100+ * @return encoded private key
101+ * @throws CoseException - from lower level
101102 */
102103 public static byte [] EncodeEcPrivateKey (byte [] oid , byte [] keyBytes , byte [] spki ) throws CoseException
103104 {
@@ -170,7 +171,7 @@ public static ArrayList<TagValue> DecodeSubjectPublicKeyInfo(byte[] encoding) th
170171 * @param offset - starting offset in array to begin decoding
171172 * @param encoding - bytes of the ASN.1 encoded value
172173 * @return Decoded structure
173- * @throws CoseException
174+ * @throws CoseException - ASN.1 encoding errors
174175 */
175176 public static TagValue DecodeCompound (int offset , byte [] encoding ) throws CoseException
176177 {
@@ -214,11 +215,11 @@ public static TagValue DecodeCompound(int offset, byte[] encoding) throws CoseEx
214215 /**
215216 * Encode a private key into a PKCS#8 private key structure.
216217 *
217- * @param oid - EC curve OID
218+ * @param algorithm - EC curve OID
218219 * @param keyBytes - raw bytes of the key
219220 * @param spki - optional subject public key info structure to include
220221 * @return byte array of encoded bytes
221- * @throws CoseException
222+ * @throws CoseException - ASN.1 encoding errors
222223 */
223224 public static byte [] EncodePKCS8 (byte [] algorithm , byte [] keyBytes , byte [] spki ) throws CoseException
224225 {
@@ -255,7 +256,7 @@ public static byte[] EncodePKCS8(byte[] algorithm, byte[] keyBytes, byte[] spki)
255256 *
256257 * @param encodedData bytes containing the private key
257258 * @return tag/value from the decoded object
258- * @throws CoseException
259+ * @throws CoseException - ASN.1 encoding errors
259260 */
260261 public static ArrayList <TagValue > DecodePKCS8 (byte [] encodedData ) throws CoseException
261262 {
0 commit comments