When I use TscKey.ImportFrom(FileName) everything works as expected, but if i copy the content of FileName into a constant it fails with "Key is broken" error.
procedure TForm7.Button1Click(Sender: TObject);
const
PUBLIC_KEY = '-----BEGIN RSA PUBLIC KEY-----' +
'MIIBCgKCAQEAsPbhyj0fxR0QWjCpYGPju3d69kzaJvnZZJvQW7M90mLMKRiixubL' +
'McrjORrX13+2Tz7k6gjQFCKD9JbinBvRuQX3a2gRkoURDZ4SyN4/cv6ItUDXzbHC' +
'yltm8GnYM5fY7kn5hYhpe6yF0b4t8lt4q7KXzcs6Ia0al6OD2NzE57lnaN/ESmcL' +
'iT+aH6rU3B2GY3hRMr+tiAdDULLz/vSQ5nOrlSIU18IIFKba6ioBC43e3gAZwx5n' +
'PtsrtdjEOq670Y7W9Pu8ZtAYOz/Kmj0v4XCMbgWIdb/hmQiNs8/CRJ1qWzo9P++t' +
'z1Gms1hDCdtBYSEIs7XxPxi6cG9HRQdwqQIDAQAB' +
'-----END RSA PUBLIC KEY-----';
var
Key: TscKey;
SStream: TStringStream;
begin
Key := TScKey.Create(ScMemoryStorage1.Keys);
SStream:=TStringStream.Create(PUBLIC_KEY);
SStream.Position := 0;
//Key.ImportFrom(SStream); //"Key is broken" error
Key.ImportFrom('C:\publicKey.pem'); //OK publicKey.pem -> PUBLIC_KEY
Key.KeyName := 'ThePublicKey';
end;