Skip to main content

CertificateAddPublic

Uploads a trading partner's public certificate to a communication channel (Comm), enabling encrypted or signed EDI exchange with that partner.

:::caution Established API The SOAP API is in maintenance mode. For new integrations use the REST equivalent. :::

Method Signature

CommIDInfo CertificateAddPublic(string SessionID, int CommID, CertificateType CertType,
string KeyId, string UserId, datetime BeginUsage, CertificateUsage Usage,
string PartnerCommID, string PartnerURL, base64Binary Cert)

Parameters

ParameterTypeRequiredDescription
SessionIDstringYesActive session token from Login()
CommIDintYesIdentifier of the communication channel to associate the certificate with
CertTypeCertificateTypeYesType of certificate being added (e.g., X509, PGP)
KeyIdstringYesKey identifier or thumbprint from the certificate
UserIdstringYesUser or entity identifier embedded in the certificate
BeginUsagedatetimeYesDate and time from which the certificate should be considered valid for use
UsageCertificateUsageYesIntended cryptographic use of the certificate
PartnerCommIDstringNoTrading partner's AS2 ID or communication channel identifier
PartnerURLstringNoTrading partner's AS2 endpoint URL, if applicable
Certbase64BinaryYesRaw certificate bytes encoded as Base64

Response Object — CommIDInfo

FieldTypeDescription
CommIDintCommunication channel the certificate was attached to
NetworkIDintNetwork owning the communication channel
MailboxIDintMailbox owning the communication channel
CommTypestringProtocol type of the channel (e.g., AS2, SFTP)
StatusstringCurrent status of the channel
CertKeyIDintIdentifier assigned to the newly uploaded certificate key
<!-- Example response XML -->
<CommIDInfoResult>
<CommID>5001</CommID>
<NetworkID>1</NetworkID>
<MailboxID>100</MailboxID>
<CommType>AS2</CommType>
<Status>Active</Status>
<CertKeyID>77</CertKeyID>
</CommIDInfoResult>

ENUMs

CertificateType

ValueDescription
X509X.509 standard digital certificate
PGPPGP (Pretty Good Privacy) certificate
SSHSSH public key certificate

CertificateUsage

ValueDescription
SSLUsed for TLS/SSL transport layer security
EncryptionUsed to encrypt EDI payloads
SignatureUsed to sign EDI payloads
EncryptionAndSignatureUsed for both encryption and signing

See Appendix — ENUMs for the complete enumeration definitions.

Code Examples

// .NET 10 — dotnet-svcutil generated proxy
// Upload a trading partner's X.509 public certificate for AS2 encryption
byte[] certBytes = await File.ReadAllBytesAsync("/secure/partner-public.cer");

var commInfo = await client.CertificateAddPublicAsync(
sessionID,
commID: 5001,
certType: CertificateType.X509,
keyId: "PARTNER-CERT-001",
userId: "PARTNERID",
beginUsage: DateTime.UtcNow,
usage: CertificateUsage.Encryption,
partnerCommID: "PARTNER-AS2-ID",
partnerURL: "https://partner.example.com/as2",
cert: certBytes);

Console.WriteLine($"Certificate uploaded. CertKeyID: {commInfo.CertKeyID}");

REST Equivalent

See Add Public CertificatePOST /v2/certificates/add-public.