Skip to content

Commit

Permalink
Add password parameter for pkcs12 key import (#266)
Browse files Browse the repository at this point in the history
* Add password parameter for encrypted PKCS12 key import

* OA3 generate

* update certificate doc

* changelogs
  • Loading branch information
patrickcping authored Oct 18, 2023
1 parent 6d87d8f commit 78701dc
Show file tree
Hide file tree
Showing 7 changed files with 69 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* **Enhancement** Added `DisplayName`, `SourceId` and `SourceType` object attributes to the `Group` object model. [#264](https://github.com/patrickcping/pingone-go-sdk-v2/pull/264)
* **Enhancement** Added `TlsClientAuthKeyPair` object attributes to the `Subscription` object model. [#265](https://github.com/patrickcping/pingone-go-sdk-v2/pull/265)
* **Enhancement** Added `OUTBOUND_MTLS` to the `EnumCertificateKeyUsageType` enum. [#265](https://github.com/patrickcping/pingone-go-sdk-v2/pull/265)
* **Enhancement** Added ability to set a PKCS12 keystore password when building a `CreateKeyRequest`. [#266](https://github.com/patrickcping/pingone-go-sdk-v2/pull/266)

# Release (2023-10-16)

Expand Down
1 change: 1 addition & 0 deletions management/.openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ docs/BrandingThemeConfigurationLogo.md
docs/BrandingThemeDefault.md
docs/BrandingThemesApi.md
docs/CapabilitiesApi.md
docs/Certificate.md
docs/CertificateKeyUpdate.md
docs/CertificateManagementApi.md
docs/CreateApplication201Response.md
Expand Down
1 change: 1 addition & 0 deletions management/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* **Enhancement** Added `DisplayName`, `SourceId` and `SourceType` object attributes to the `Group` object model. [#264](https://github.com/patrickcping/pingone-go-sdk-v2/pull/264)
* **Enhancement** Added `TlsClientAuthKeyPair` object attributes to the `Subscription` object model. [#265](https://github.com/patrickcping/pingone-go-sdk-v2/pull/265)
* **Enhancement** Added `OUTBOUND_MTLS` to the `EnumCertificateKeyUsageType` enum. [#265](https://github.com/patrickcping/pingone-go-sdk-v2/pull/265)
* **Enhancement** Added ability to set a PKCS12 keystore password when building a `CreateKeyRequest`. [#266](https://github.com/patrickcping/pingone-go-sdk-v2/pull/266)

# v0.30.0 (2023-10-16)

Expand Down
16 changes: 15 additions & 1 deletion management/api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5171,7 +5171,7 @@ paths:
$ref: '#/components/schemas/Certificate'
multipart/form-data:
schema:
$ref: '#/components/schemas/PKIFileUpload'
$ref: '#/components/schemas/PKIKeyFileUpload'
responses:
"400":
content:
Expand Down Expand Up @@ -29282,6 +29282,20 @@ components:
- file
- usageType
type: object
PKIKeyFileUpload:
properties:
usageType:
example: ENCRYPTION
type: string
file:
format: binary
type: string
password:
type: string
required:
- file
- usageType
type: object
Population:
example:
createdAt: createdAt
Expand Down
9 changes: 9 additions & 0 deletions management/api_certificate_management.go
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,7 @@ type ApiCreateKeyRequest struct {
contentType *string
certificate *Certificate
file **[]byte
password *string
usageType *string
}

Expand All @@ -277,6 +278,11 @@ func (r ApiCreateKeyRequest) UsageType(usageType string) ApiCreateKeyRequest {
return r
}

func (r ApiCreateKeyRequest) Password(password string) ApiCreateKeyRequest {
r.password = &password
return r
}

func (r ApiCreateKeyRequest) File(file *[]byte) ApiCreateKeyRequest {
r.file = &file
return r
Expand Down Expand Up @@ -381,6 +387,9 @@ func (a *CertificateManagementApiService) internalCreateKeyExecute(r ApiCreateKe
if localVarHeaderParams["Content-Type"] == "multipart/form-data" {

localVarFormParams.Add("usageType", parameterValueToString(*r.usageType, ""))
if r.password != nil {
localVarFormParams.Add("password", parameterValueToString(*r.password, ""))
}
var fileLocalVarFormFileName string
var fileLocalVarFileBytes *[]byte

Expand Down
28 changes: 27 additions & 1 deletion management/docs/Certificate.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Links** | Pointer to [**LinksHATEOAS**](LinksHATEOAS.md) | | [optional]
**Algorithm** | [**EnumCertificateKeyAlgorithm**](EnumCertificateKeyAlgorithm.md) | |
**CreatedAt** | Pointer to **time.Time** | The time the resource was created. | [optional] [readonly]
**Default** | Pointer to **bool** | Specifies whether this is the default key for the specified environment. | [optional]
**Environment** | Pointer to [**ObjectEnvironment**](ObjectEnvironment.md) | | [optional]
**ExpiresAt** | Pointer to **time.Time** | The time the key resource expires. | [optional] [readonly]
**Id** | Pointer to **string** | Specifies the resource’s unique identifier. | [optional] [readonly]
**IssuerDN** | Pointer to **string** | Specifies the distinguished name of the certificate issuer. | [optional]
**KeyLength** | **int32** | Specifies the key length. For RSA keys, options are 2048, 3072, and 7680. For elliptical curve (EC) keys, options are 224, 256, and 384. |
**KeyLength** | **int32** | The key length. For RSA keys, options are `2048`, `3072`, `4096`, and `7680`. For elliptical curve (EC) keys, options are `224`, `256`, `384`, and `521`. |
**Name** | **string** | Specifies the resource name. |
**Organization** | Pointer to [**ObjectOrganization**](ObjectOrganization.md) | | [optional]
**SerialNumber** | Pointer to **big.Int** | Specifies the serial number of the key or certificate. | [optional]
Expand Down Expand Up @@ -42,6 +43,31 @@ NewCertificateWithDefaults instantiates a new Certificate object
This constructor will only assign default values to properties that have it defined,
but it doesn't guarantee that properties required by API are set

### GetLinks

`func (o *Certificate) GetLinks() LinksHATEOAS`

GetLinks returns the Links field if non-nil, zero value otherwise.

### GetLinksOk

`func (o *Certificate) GetLinksOk() (*LinksHATEOAS, bool)`

GetLinksOk returns a tuple with the Links field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.

### SetLinks

`func (o *Certificate) SetLinks(v LinksHATEOAS)`

SetLinks sets Links field to given value.

### HasLinks

`func (o *Certificate) HasLinks() bool`

HasLinks returns a boolean if a field has been set.

### GetAlgorithm

`func (o *Certificate) GetAlgorithm() EnumCertificateKeyAlgorithm`
Expand Down
16 changes: 15 additions & 1 deletion management/generate/pingone-management.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4272,6 +4272,20 @@ components:
required:
- file
- usageType
PKIKeyFileUpload:
type: object
properties:
usageType:
type: string
example: ENCRYPTION
file:
type: string
format: binary
password:
type: string
required:
- file
- usageType
Population:
type: object
properties:
Expand Down Expand Up @@ -8997,7 +9011,7 @@ paths:
$ref: '#/components/schemas/Certificate'
multipart/form-data:
schema:
$ref: '#/components/schemas/PKIFileUpload'
$ref: '#/components/schemas/PKIKeyFileUpload'
parameters:
- name: Content-Type
in: header
Expand Down

0 comments on commit 78701dc

Please sign in to comment.