diff --git a/examples/soap-client-security-inbound-security-config/soap_client_security_inbound_security_config.bal b/examples/soap-client-security-inbound-security-config/soap_client_security_inbound_security_config.bal index e41acdf9cc..c54e86c8cf 100644 --- a/examples/soap-client-security-inbound-security-config/soap_client_security_inbound_security_config.bal +++ b/examples/soap-client-security-inbound-security-config/soap_client_security_inbound_security_config.bal @@ -1,17 +1,23 @@ -import ballerina/soap; import ballerina/soap.soap12; public function main() returns error? { + crypto:KeyStore keyStore = { + path: "/path/to/keyStore.p12", + password: "keyStorePassword" + }; + crypto:KeyStore decryptionKeyStore = { + path: "/path/to/keyStore.p12", + password: "keyStorePassword" + }; + soap12:Client soapClient = check new ("http://soap-endpoint.com?wsdl", { inboundSecurity: { - username: "user", - password: "password", - passwordType: soap:TEXT + signatureKeystore: keyStore, + decryptKeystore: decryptionKeyStore } } ); - xml body = xml ` `; diff --git a/examples/soap-client-security-outbound-security-config/soap_client_security_outbound_security_config.bal b/examples/soap-client-security-outbound-security-config/soap_client_security_outbound_security_config.bal index 21607b2975..b17bd9f06b 100644 --- a/examples/soap-client-security-outbound-security-config/soap_client_security_outbound_security_config.bal +++ b/examples/soap-client-security-outbound-security-config/soap_client_security_outbound_security_config.bal @@ -1,26 +1,31 @@ import ballerina/crypto; -import ballerina/soap; import ballerina/soap.soap12; public function main() returns error? { - crypto:PrivateKey verificationKey = check crypto:decodeRsaPrivateKeyFromKeyFile( - "../resource/path/to/private.key" - ); - crypto:PublicKey decryptionKey = check crypto:decodeRsaPublicKeyFromCertFile( - "../resource/path/to/public.crt" - ); + crypto:KeyStore keyStore = { + path: "/path/to/keyStore.p12", + password: "keyStorePassword" + }; + crypto:KeyStore decryptionKeyStore = { + path: "/path/to/decryptionKeyStore.p12", + password: "keyStorePassword" + }; soap12:Client soapClient = check new ("http://soap-endpoint.com?wsdl", { outboundSecurity: { - verificationKey: verificationKey, - signatureAlgorithm: soap:RSA_SHA256, - decryptionKey: decryptionKey, - decryptionAlgorithm: soap:RSA_ECB + signatureConfig: { + keystore: keyStore, + privateKeyAlias: "private-key-alias", + privateKeyPassword: "private-key-password" + }, + encryptionConfig: { + keystore: decryptionKeyStore, + publicKeyAlias: "public-key-alias" + } } } ); - xml body = xml ` `;