Package io.jans.fido2.service
Class CoseService
java.lang.Object
io.jans.fido2.service.CoseService
Utility classes for COSE key structure.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.fasterxml.jackson.databind.JsonNodeconvertECKeyToUncompressedPoint(byte[] encodedPublicKey) convertRawKeyToEdDSAKey(int curve, byte[] rawKey) Rebuilds an Edwards-curve public key from the raw COSE OKP parameters, by wrapping the raw key in the SubjectPublicKeyInfo structureKeyFactoryexpects.convertRawKeyToMLDSAKey(CoseMLDSAAlgorithm algorithm, byte[] rawKey) Rebuilds an ML-DSA public key from the raw COSE AKP parameter, by wrapping it in the SubjectPublicKeyInfo structureKeyFactoryexpects.convertUncompressedPointToECKey(byte[] uncompressedPoint, int curve) createUncompressedPointFromCOSEPublicKey(com.fasterxml.jackson.databind.JsonNode uncompressedECPointNode) decodePublicKey(byte[] encodedPublicKey) intgetCodeCurve(com.fasterxml.jackson.databind.JsonNode uncompressedECPointNode) getPublicKeyFromUncompressedECPoint(byte[] uncompressedECPointCOSEPubKey) booleanisDecodable(int algorithm) Whether this service can build a public key for the given COSE algorithm code point.static byte[]toUncompressedCoord(byte[] coord, int keySizeBytes)
-
Constructor Details
-
CoseService
public CoseService()
-
-
Method Details
-
getCodeCurve
public int getCodeCurve(com.fasterxml.jackson.databind.JsonNode uncompressedECPointNode) -
isDecodable
public boolean isDecodable(int algorithm) Whether this service can build a public key for the given COSE algorithm code point. The advertised algorithm set is filtered through this, so we never offer an algorithm in pubKeyCredParams whose credentials we would then fail to decode. -
createUncompressedPointFromCOSEPublicKey
public PublicKey createUncompressedPointFromCOSEPublicKey(com.fasterxml.jackson.databind.JsonNode uncompressedECPointNode) -
convertRawKeyToMLDSAKey
Rebuilds an ML-DSA public key from the raw COSE AKP parameter, by wrapping it in the SubjectPublicKeyInfo structureKeyFactoryexpects. The key is produced with the same provider SignatureVerifier uses, so a deployment whose provider lacks ML-DSA fails here rather than later - and because the advertised set is derived from that same capability, such a deployment never offers it. -
convertRawKeyToEdDSAKey
Rebuilds an Edwards-curve public key from the raw COSE OKP parameters, by wrapping the raw key in the SubjectPublicKeyInfo structureKeyFactoryexpects. The key is produced with the same provider SignatureVerifier uses, so it stays valid on the FIPS build variant. -
convertUncompressedPointToECKey
-
getPublicKeyFromUncompressedECPoint
-
convertECKeyToUncompressedPoint
public com.fasterxml.jackson.databind.JsonNode convertECKeyToUncompressedPoint(byte[] encodedPublicKey) -
toUncompressedCoord
public static byte[] toUncompressedCoord(byte[] coord, int keySizeBytes) -
decodePublicKey
public PublicKey decodePublicKey(byte[] encodedPublicKey) throws io.jans.as.model.exception.SignatureException - Throws:
io.jans.as.model.exception.SignatureException
-