We using following code reference from Knox SDK API reference seap - 
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context);
CertificatePolicy certificatePolicy = edm.getCertificatePolicy();
try {
    if (certificatePolicy.setNonTrustedAppInstallBlock(true)) {
        Log.w(TAG, "only trusted apps can be installed");
    } else {
        Log.w(TAG, "Failed to enable the policy.");
    }
} catch (SecurityException e) {
    Log.w(TAG, "SecurityException: " + e);
}

 

But getting error at edm.getCertificatePolicy() line.

"Can not resolve method getCertificatePolicy()"

 

Thanks

 

Konrad Sobczak
Selected Answer
Jan 11, 2019
12:32 pm

Hello Sayaji Kadam,

Please try using following code to access CertificatePolicy.

 

EnterpriseKnoxManager enterpriseKnoxManager = EnterpriseKnoxManager.getInstance(this);
CertificatePolicy certificatePolicy = enterpriseKnoxManager.getCertificatePolicy();

 

Best regards, Konrad.

Sayaji Kadam
Jan 11, 2019
12:42 pm