From 09c8a50f4ac375488d89a35759761f252bbd361e Mon Sep 17 00:00:00 2001 From: vkanellopoulos Date: Tue, 12 Nov 2024 10:01:26 +0200 Subject: [PATCH] update kdoc --- README.md | 2 +- .../-authorized-impl/-authorized-impl.md | 14 +++++++ .../-authorized-impl/index.md | 21 ++++++++-- .../-credential-authorized-impl.md | 14 +++++++ .../-credential-authorized-impl/index.md | 19 +++++++-- .../-r-q-e-s-service-impl.md | 2 + .../-r-q-e-s-service-impl/index.md | 6 ++- .../-r-q-e-s-service/-companion/invoke.md | 16 ++++++++ .../europa/ec/eudi/rqes/core/RQESService.kt | 7 ++++ .../ec/eudi/rqes/core/RQESServiceImpl.kt | 39 +++++++++++++++++++ .../ec/eudi/rqes/core/UnsignedDocument.kt | 2 + .../ec/eudi/rqes/core/UnsignedDocuments.kt | 2 + 12 files changed, 134 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 610f28b..1f2683a 100644 --- a/README.md +++ b/README.md @@ -80,7 +80,7 @@ val rqesService = RQESService( authFlowRedirectionURI = URI("rqes:redirect"), scaBaseURL = URL("https://example.com"), ), - // set the default hash algorithm to use when signing documents + // set the hashing and singing algorithms that will be used hashAlgorithm = HashAlgorithmOID.SHA_256, signingAlgorithm = SigningAlgorithmOID.RSA_SHA256, // optionally provide a HttpClientFactory to create a HttpClient for the service diff --git a/docs/rqes-core/eu.europa.ec.eudi.rqes.core/-r-q-e-s-service-impl/-authorized-impl/-authorized-impl.md b/docs/rqes-core/eu.europa.ec.eudi.rqes.core/-r-q-e-s-service-impl/-authorized-impl/-authorized-impl.md index 6d39271..adba87c 100644 --- a/docs/rqes-core/eu.europa.ec.eudi.rqes.core/-r-q-e-s-service-impl/-authorized-impl/-authorized-impl.md +++ b/docs/rqes-core/eu.europa.ec.eudi.rqes.core/-r-q-e-s-service-impl/-authorized-impl/-authorized-impl.md @@ -4,3 +4,17 @@ [androidJvm]\ constructor(serverState: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html), client: CSCClient, serviceAccessAuthorized: ServiceAccessAuthorized, hashAlgorithm: HashAlgorithmOID, signingAlgorithm: SigningAlgorithmOID) + +Creates an authorized service implementation. + +#### Parameters + +androidJvm + +| | | +|---|---| +| serverState | The server state. | +| client | The client. | +| serviceAccessAuthorized | The service access authorized. | +| hashAlgorithm | The algorithm OID, for hashing the documents. | +| signingAlgorithm | The algorithm OID, for signing the documents. | diff --git a/docs/rqes-core/eu.europa.ec.eudi.rqes.core/-r-q-e-s-service-impl/-authorized-impl/index.md b/docs/rqes-core/eu.europa.ec.eudi.rqes.core/-r-q-e-s-service-impl/-authorized-impl/index.md index ff80d29..efa283d 100644 --- a/docs/rqes-core/eu.europa.ec.eudi.rqes.core/-r-q-e-s-service-impl/-authorized-impl/index.md +++ b/docs/rqes-core/eu.europa.ec.eudi.rqes.core/-r-q-e-s-service-impl/-authorized-impl/index.md @@ -2,21 +2,34 @@ # AuthorizedImpl -[androidJvm]\ class [AuthorizedImpl](index.md)(serverState: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html), client: CSCClient, serviceAccessAuthorized: ServiceAccessAuthorized, val hashAlgorithm: HashAlgorithmOID, val signingAlgorithm: SigningAlgorithmOID) : [RQESService.Authorized](../../-r-q-e-s-service/-authorized/index.md) +The authorized service implementation. + +#### Parameters + +androidJvm + +| | | +|---|---| +| serverState | The server state. | +| client | The client. | +| serviceAccessAuthorized | The service access authorized. | +| hashAlgorithm | The algorithm OID, for hashing the documents. | +| signingAlgorithm | The algorithm OID, for signing the documents. | + ## Constructors | | | |---|---| -| [AuthorizedImpl](-authorized-impl.md) | [androidJvm]
constructor(serverState: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html), client: CSCClient, serviceAccessAuthorized: ServiceAccessAuthorized, hashAlgorithm: HashAlgorithmOID, signingAlgorithm: SigningAlgorithmOID) | +| [AuthorizedImpl](-authorized-impl.md) | [androidJvm]
constructor(serverState: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html), client: CSCClient, serviceAccessAuthorized: ServiceAccessAuthorized, hashAlgorithm: HashAlgorithmOID, signingAlgorithm: SigningAlgorithmOID)
Creates an authorized service implementation. | ## Properties | Name | Summary | |---|---| -| [hashAlgorithm](hash-algorithm.md) | [androidJvm]
val [hashAlgorithm](hash-algorithm.md): HashAlgorithmOID | -| [signingAlgorithm](signing-algorithm.md) | [androidJvm]
val [signingAlgorithm](signing-algorithm.md): SigningAlgorithmOID | +| [hashAlgorithm](hash-algorithm.md) | [androidJvm]
val [hashAlgorithm](hash-algorithm.md): HashAlgorithmOID
The algorithm OID, for hashing the documents. | +| [signingAlgorithm](signing-algorithm.md) | [androidJvm]
val [signingAlgorithm](signing-algorithm.md): SigningAlgorithmOID
The algorithm OID, for signing the documents. | ## Functions diff --git a/docs/rqes-core/eu.europa.ec.eudi.rqes.core/-r-q-e-s-service-impl/-credential-authorized-impl/-credential-authorized-impl.md b/docs/rqes-core/eu.europa.ec.eudi.rqes.core/-r-q-e-s-service-impl/-credential-authorized-impl/-credential-authorized-impl.md index aa51fb5..b6a969e 100644 --- a/docs/rqes-core/eu.europa.ec.eudi.rqes.core/-r-q-e-s-service-impl/-credential-authorized-impl/-credential-authorized-impl.md +++ b/docs/rqes-core/eu.europa.ec.eudi.rqes.core/-r-q-e-s-service-impl/-credential-authorized-impl/-credential-authorized-impl.md @@ -4,3 +4,17 @@ [androidJvm]\ constructor(client: CSCClient, documentsToSign: [List](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)<DocumentToSign>, documentDigestList: DocumentDigestList, credentialAuthorized: CredentialAuthorized, signingAlgorithm: SigningAlgorithmOID) + +Creates a credential authorized implementation. + +#### Parameters + +androidJvm + +| | | +|---|---| +| client | The client. | +| documentsToSign | The documents to sign. | +| documentDigestList | The document digest list. | +| credentialAuthorized | The credential authorized. | +| signingAlgorithm | The algorithm OID, for signing the documents. | diff --git a/docs/rqes-core/eu.europa.ec.eudi.rqes.core/-r-q-e-s-service-impl/-credential-authorized-impl/index.md b/docs/rqes-core/eu.europa.ec.eudi.rqes.core/-r-q-e-s-service-impl/-credential-authorized-impl/index.md index 667a378..81e4fef 100644 --- a/docs/rqes-core/eu.europa.ec.eudi.rqes.core/-r-q-e-s-service-impl/-credential-authorized-impl/index.md +++ b/docs/rqes-core/eu.europa.ec.eudi.rqes.core/-r-q-e-s-service-impl/-credential-authorized-impl/index.md @@ -2,20 +2,33 @@ # CredentialAuthorizedImpl -[androidJvm]\ class [CredentialAuthorizedImpl](index.md)(client: CSCClient, documentsToSign: [List](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)<DocumentToSign>, documentDigestList: DocumentDigestList, credentialAuthorized: CredentialAuthorized, val signingAlgorithm: SigningAlgorithmOID) : [RQESService.CredentialAuthorized](../../-r-q-e-s-service/-credential-authorized/index.md) +The credential authorized implementation. + +#### Parameters + +androidJvm + +| | | +|---|---| +| client | The client. | +| documentsToSign | The documents to sign. | +| documentDigestList | The document digest list. | +| credentialAuthorized | The credential authorized. | +| signingAlgorithm | The algorithm OID, for signing the documents. | + ## Constructors | | | |---|---| -| [CredentialAuthorizedImpl](-credential-authorized-impl.md) | [androidJvm]
constructor(client: CSCClient, documentsToSign: [List](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)<DocumentToSign>, documentDigestList: DocumentDigestList, credentialAuthorized: CredentialAuthorized, signingAlgorithm: SigningAlgorithmOID) | +| [CredentialAuthorizedImpl](-credential-authorized-impl.md) | [androidJvm]
constructor(client: CSCClient, documentsToSign: [List](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)<DocumentToSign>, documentDigestList: DocumentDigestList, credentialAuthorized: CredentialAuthorized, signingAlgorithm: SigningAlgorithmOID)
Creates a credential authorized implementation. | ## Properties | Name | Summary | |---|---| -| [signingAlgorithm](signing-algorithm.md) | [androidJvm]
val [signingAlgorithm](signing-algorithm.md): SigningAlgorithmOID | +| [signingAlgorithm](signing-algorithm.md) | [androidJvm]
val [signingAlgorithm](signing-algorithm.md): SigningAlgorithmOID
The algorithm OID, for signing the documents. | ## Functions diff --git a/docs/rqes-core/eu.europa.ec.eudi.rqes.core/-r-q-e-s-service-impl/-r-q-e-s-service-impl.md b/docs/rqes-core/eu.europa.ec.eudi.rqes.core/-r-q-e-s-service-impl/-r-q-e-s-service-impl.md index ff2caeb..d5fa948 100644 --- a/docs/rqes-core/eu.europa.ec.eudi.rqes.core/-r-q-e-s-service-impl/-r-q-e-s-service-impl.md +++ b/docs/rqes-core/eu.europa.ec.eudi.rqes.core/-r-q-e-s-service-impl/-r-q-e-s-service-impl.md @@ -15,4 +15,6 @@ androidJvm |---|---| | serviceEndpointUrl | The RQES service endpoint URL. | | config | The RQES service configuration. | +| hashAlgorithm | The algorithm OID, for hashing the documents. | +| signingAlgorithm | The algorithm OID, for signing the documents. | | clientFactory | The HTTP client factory. If this property is null, the default HTTP client factory will be used. | diff --git a/docs/rqes-core/eu.europa.ec.eudi.rqes.core/-r-q-e-s-service-impl/index.md b/docs/rqes-core/eu.europa.ec.eudi.rqes.core/-r-q-e-s-service-impl/index.md index 84d7b41..6b6ab55 100644 --- a/docs/rqes-core/eu.europa.ec.eudi.rqes.core/-r-q-e-s-service-impl/index.md +++ b/docs/rqes-core/eu.europa.ec.eudi.rqes.core/-r-q-e-s-service-impl/index.md @@ -14,6 +14,8 @@ androidJvm |---|---| | serviceEndpointUrl | The RQES service endpoint URL. | | config | The RQES service configuration. | +| hashAlgorithm | The algorithm OID, for hashing the documents. | +| signingAlgorithm | The algorithm OID, for signing the documents. | | clientFactory | The HTTP client factory. If this property is null, the default HTTP client factory will be used. | ## Constructors @@ -26,8 +28,8 @@ androidJvm | Name | Summary | |---|---| -| [AuthorizedImpl](-authorized-impl/index.md) | [androidJvm]
class [AuthorizedImpl](-authorized-impl/index.md)(serverState: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html), client: CSCClient, serviceAccessAuthorized: ServiceAccessAuthorized, val hashAlgorithm: HashAlgorithmOID, val signingAlgorithm: SigningAlgorithmOID) : [RQESService.Authorized](../-r-q-e-s-service/-authorized/index.md) | -| [CredentialAuthorizedImpl](-credential-authorized-impl/index.md) | [androidJvm]
class [CredentialAuthorizedImpl](-credential-authorized-impl/index.md)(client: CSCClient, documentsToSign: [List](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)<DocumentToSign>, documentDigestList: DocumentDigestList, credentialAuthorized: CredentialAuthorized, val signingAlgorithm: SigningAlgorithmOID) : [RQESService.CredentialAuthorized](../-r-q-e-s-service/-credential-authorized/index.md) | +| [AuthorizedImpl](-authorized-impl/index.md) | [androidJvm]
class [AuthorizedImpl](-authorized-impl/index.md)(serverState: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html), client: CSCClient, serviceAccessAuthorized: ServiceAccessAuthorized, val hashAlgorithm: HashAlgorithmOID, val signingAlgorithm: SigningAlgorithmOID) : [RQESService.Authorized](../-r-q-e-s-service/-authorized/index.md)
The authorized service implementation. | +| [CredentialAuthorizedImpl](-credential-authorized-impl/index.md) | [androidJvm]
class [CredentialAuthorizedImpl](-credential-authorized-impl/index.md)(client: CSCClient, documentsToSign: [List](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)<DocumentToSign>, documentDigestList: DocumentDigestList, credentialAuthorized: CredentialAuthorized, val signingAlgorithm: SigningAlgorithmOID) : [RQESService.CredentialAuthorized](../-r-q-e-s-service/-credential-authorized/index.md)
The credential authorized implementation. | ## Properties diff --git a/docs/rqes-core/eu.europa.ec.eudi.rqes.core/-r-q-e-s-service/-companion/invoke.md b/docs/rqes-core/eu.europa.ec.eudi.rqes.core/-r-q-e-s-service/-companion/invoke.md index 242f54f..d25612e 100644 --- a/docs/rqes-core/eu.europa.ec.eudi.rqes.core/-r-q-e-s-service/-companion/invoke.md +++ b/docs/rqes-core/eu.europa.ec.eudi.rqes.core/-r-q-e-s-service/-companion/invoke.md @@ -6,3 +6,19 @@ operator fun [invoke](invoke.md)(serviceEndpointUrl: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html), config: CSCClientConfig, hashAlgorithm: HashAlgorithmOID = HashAlgorithmOID.SHA_256, signingAlgorithm: SigningAlgorithmOID = SigningAlgorithmOID.RSA_SHA256, httpClientFactory: () -> HttpClient? = null): [RQESService](../index.md) Create the RQES service. + +#### Return + +The RQES service. + +#### Parameters + +androidJvm + +| | | +|---|---| +| serviceEndpointUrl | The service endpoint URL. | +| config | The CSC client configuration. | +| hashAlgorithm | The hash algorithm OID. | +| signingAlgorithm | The signing algorithm OID. | +| httpClientFactory | The HTTP client factory. | diff --git a/rqes-core/src/main/kotlin/eu/europa/ec/eudi/rqes/core/RQESService.kt b/rqes-core/src/main/kotlin/eu/europa/ec/eudi/rqes/core/RQESService.kt index 310bafa..3324c9b 100644 --- a/rqes-core/src/main/kotlin/eu/europa/ec/eudi/rqes/core/RQESService.kt +++ b/rqes-core/src/main/kotlin/eu/europa/ec/eudi/rqes/core/RQESService.kt @@ -149,6 +149,13 @@ interface RQESService { companion object { /** * Create the RQES service. + * + * @param serviceEndpointUrl The service endpoint URL. + * @param config The CSC client configuration. + * @param hashAlgorithm The hash algorithm OID. + * @param signingAlgorithm The signing algorithm OID. + * @param httpClientFactory The HTTP client factory. + * @return The RQES service. */ operator fun invoke( serviceEndpointUrl: String, diff --git a/rqes-core/src/main/kotlin/eu/europa/ec/eudi/rqes/core/RQESServiceImpl.kt b/rqes-core/src/main/kotlin/eu/europa/ec/eudi/rqes/core/RQESServiceImpl.kt index f47e788..7d42ff2 100644 --- a/rqes-core/src/main/kotlin/eu/europa/ec/eudi/rqes/core/RQESServiceImpl.kt +++ b/rqes-core/src/main/kotlin/eu/europa/ec/eudi/rqes/core/RQESServiceImpl.kt @@ -45,11 +45,15 @@ import kotlin.uuid.Uuid * * @property serviceEndpointUrl The RQES service endpoint URL. * @property config The RQES service configuration. + * @property hashAlgorithm The algorithm OID, for hashing the documents. + * @property signingAlgorithm The algorithm OID, for signing the documents. * @property clientFactory The HTTP client factory. If this property is null, the default HTTP client factory will be used. * * @constructor Creates a RQES service implementation. * @param serviceEndpointUrl The RQES service endpoint URL. * @param config The RQES service configuration. + * @param hashAlgorithm The algorithm OID, for hashing the documents. + * @param signingAlgorithm The algorithm OID, for signing the documents. * @param clientFactory The HTTP client factory. If this property is null, the default HTTP client factory will be used. */ class RQESServiceImpl( @@ -145,6 +149,25 @@ class RQESServiceImpl( } + /** + * The authorized service implementation. + * + * @property serverState The server state. + * @property client The client. + * @property serviceAccessAuthorized The service access authorized. + * @property hashAlgorithm The algorithm OID, for hashing the documents. + * @property signingAlgorithm The algorithm OID, for signing the documents. + * @property documentsToSign The documents to sign. + * @property documentDigestList The document digest list. + * @property credAuthRequestPrepared The credential authorization request prepared. + * + * @constructor Creates an authorized service implementation. + * @param serverState The server state. + * @param client The client. + * @param serviceAccessAuthorized The service access authorized. + * @param hashAlgorithm The algorithm OID, for hashing the documents. + * @param signingAlgorithm The algorithm OID, for signing the documents. + */ class AuthorizedImpl( @VisibleForTesting internal val serverState: String, @VisibleForTesting internal val client: CSCClient, @@ -236,6 +259,22 @@ class RQESServiceImpl( } } + /** + * The credential authorized implementation. + * + * @property client The client. + * @property documentsToSign The documents to sign. + * @property documentDigestList The document digest list. + * @property credentialAuthorized The credential authorized. + * @property signingAlgorithm The algorithm OID, for signing the documents. + * + * @constructor Creates a credential authorized implementation. + * @param client The client. + * @param documentsToSign The documents to sign. + * @param documentDigestList The document digest list. + * @param credentialAuthorized The credential authorized. + * @param signingAlgorithm The algorithm OID, for signing the documents. + */ class CredentialAuthorizedImpl( @VisibleForTesting internal val client: CSCClient, @VisibleForTesting internal val documentsToSign: List, diff --git a/rqes-core/src/main/kotlin/eu/europa/ec/eudi/rqes/core/UnsignedDocument.kt b/rqes-core/src/main/kotlin/eu/europa/ec/eudi/rqes/core/UnsignedDocument.kt index a09fe2a..4d2646c 100644 --- a/rqes-core/src/main/kotlin/eu/europa/ec/eudi/rqes/core/UnsignedDocument.kt +++ b/rqes-core/src/main/kotlin/eu/europa/ec/eudi/rqes/core/UnsignedDocument.kt @@ -76,6 +76,8 @@ data class UnsignedDocument( /** * Converts this [UnsignedDocument] to a [DocumentToSign]. + * @param signingAlgorithmOID The signing algorithm OID. + * @return The [DocumentToSign] object. */ internal fun asDocumentToSign(signingAlgorithmOID: SigningAlgorithmOID): DocumentToSign = DocumentToSign( diff --git a/rqes-core/src/main/kotlin/eu/europa/ec/eudi/rqes/core/UnsignedDocuments.kt b/rqes-core/src/main/kotlin/eu/europa/ec/eudi/rqes/core/UnsignedDocuments.kt index d7d427a..872ffc5 100644 --- a/rqes-core/src/main/kotlin/eu/europa/ec/eudi/rqes/core/UnsignedDocuments.kt +++ b/rqes-core/src/main/kotlin/eu/europa/ec/eudi/rqes/core/UnsignedDocuments.kt @@ -38,6 +38,8 @@ class UnsignedDocuments( /** * Converts this [UnsignedDocuments] to a list of [DocumentToSign]s. + * @param signingAlgorithmOID The OID of the signing algorithm to be used for the signing process. + * @return The list of [DocumentToSign]s. */ internal fun asDocumentToSignList( signingAlgorithmOID: SigningAlgorithmOID