Certificates
A Certificate is a way to store your custom SSL certificate for your Files.com site. Files.com is also capable of registering SSL certificates itself, so this is only required if you have specific security requirements to use your own certificate.
List Certificates
SDK Method
certificate.List()
Return Values
Returns a *certificate.Iter and an error. Range over All() to receive files_sdk.Certificate values and errors.
Check each loop error before using its resource. Next() and Err() remain supported.
Authorization Requirement
Requires a Site-Wide API key, or a User API key or session from a Site Administrator.
Additional Arguments
Show Certificate
SDK Method
certificate.Find()
Return Values
Returns a files_sdk.Certificate value and an error.
Authorization Requirement
Requires a Site-Wide API key, or a User API key or session from a Site Administrator.
CertificateFindParams Fields
| Field | Description |
|---|---|
| Id int64 Required | Certificate ID. |
Create CSR or import existing SSL Certificate
SDK Method
certificate.Create()
Return Values
Returns a files_sdk.Certificate value and an error.
Authorization Requirement
Requires a Site-Wide API key, or a User API key or session from a Site Administrator.
CertificateCreateParams Fields
| Field | Description |
|---|---|
| Name string Required | Internal name of the SSL certificate. |
| CertificateDomain string | Domain for certificate. |
| CertificateExtraDomains array(string) | Additional domains for the certificate CSR. |
| CertificateCountry string | Country. |
| CertificateStateOrProvince string | State or province. |
| CertificateCityOrLocale string | City or locale. |
| CertificateCompanyName string | Company name. |
| CsrOu1 string | Department name or organization unit 1 |
| CsrOu2 string | Department name or organization unit 2 |
| CsrOu3 string | Department name or organization unit 3 |
| CertificateEmailAddress string | Email address for the certificate owner. |
| KeyType string | Any supported key type. Defaults to RSA-4096. |
| Certificate string | The certificate. PEM or PKCS7 formats accepted. |
| PrivateKey string | Certificate private key. |
| Password string | Certificate password. |
| Intermediates string | Intermediate certificates. PEM or PKCS7 formats accepted. |
Activate SSL Certificate
SDK Method
certificate.Activate()
Return Values
Returns an error, or nil on success.
Authorization Requirement
Requires a Site-Wide API key, or a User API key or session from a Site Administrator.
CertificateActivateParams Fields
| Field | Description |
|---|---|
| Id int64 Required | Certificate ID. |
| ReplaceCert string | Leave blank or set to any to replace any currently active certificate, if applicable. Set to new_ips to activate this certificate as an additional certificate on your Site by allocating a new set of Dedicated IPs (may require a Plan upgrade). Set to the ID of a currently active certificate to replace that certificate on its set of dedicated IPs. A certificate belonging to a Custom Domain activates only for that domain: leave blank, use any, or specify that domain's current certificate ID. |
Deactivate SSL Certificate
SDK Method
certificate.Deactivate()
Return Values
Returns an error, or nil on success.
Authorization Requirement
Requires a Site-Wide API key, or a User API key or session from a Site Administrator.
CertificateDeactivateParams Fields
| Field | Description |
|---|---|
| Id int64 Required | Certificate ID. |
Replace this active custom SSL Certificate for the Primary Custom Domain with a Files.com SSL Certificate. The Primary Custom Domain's CNAME record must point at the Site's subdomain. The Files.com certificate is issued and activated in the background
SDK Method
certificate.ReplaceWithFiles()
Return Values
Returns an error, or nil on success.
Authorization Requirement
Requires a Site-Wide API key, or a User API key or session from a Site Administrator.
CertificateReplaceWithFilesParams Fields
| Field | Description |
|---|---|
| Id int64 Required | Certificate ID. |
Update Certificate
SDK Method
certificate.Update()
Return Values
Returns a files_sdk.Certificate value and an error.
Authorization Requirement
Requires a Site-Wide API key, or a User API key or session from a Site Administrator.
CertificateUpdateParams Fields
| Field | Description |
|---|---|
| Id int64 Required | Certificate ID. |
| Name string | Internal certificate name. |
| Intermediates string | Any intermediate certificates. PEM or PKCS7 formats accepted. |
| Certificate string | The certificate. PEM or PKCS7 formats accepted. |
Delete Certificate
SDK Method
certificate.Delete()
Return Values
Returns an error, or nil on success.
Authorization Requirement
Requires a Site-Wide API key, or a User API key or session from a Site Administrator.
CertificateDeleteParams Fields
| Field | Description |
|---|---|
| Id int64 Required | Certificate ID. |
The Certificate Object
Some of the methods above return a Certificate object. The attributes of this object are listed below.
| Attribute | Description |
|---|---|
| Id int64 | Certificate ID |
| Name string | Descriptive name of certificate |
| CustomDomainId int64 | Custom Domain that owns this certificate, including while the certificate is inactive. |
| Certificate string | Full text of SSL certificate |
| CreatedAt date-time | Certificate created at |
| DisplayStatus string | Certificate status. (One of Request Generated, New, Active, Active/Expired, Expired, or Available) |
| Domains array(string) | Domains on this certificate other than files.com domains |
| ExpiresAt date-time | Certificate expiration date/time |
| BrickManaged boolean | Is this certificate automatically managed and renewed by Files.com? |
| Intermediates string | Intermediate certificates |
| IpAddresses array(string) | A list of IP addresses associated with this SSL Certificate |
| Issuer string | X509 issuer |
| KeyType string | Type of key |
| Request string | Certificate signing request text |
| Status string | Certificate status (Request Generated, New, Active, Active/Expired, Expired, or Available) |
| Subject string | X509 Subject name |