FORUMS PROFESSIONNELS
WINDEV
,
WEBDEV
et
WINDEV Mobile
Accueil
|
Messages récents
|
Connexion
|
Déconnexion
|
Français
Accueil
→
WINDEV 25
→
Windev - Certificado Digital - Localizar, verificar serial, verificar se esta valido e informar a quantidade de dias que falta para expirar
Windev - Certificado Digital - Localizar, verificar serial, verificar se esta valido e informar a quantidade de dias que falta para expirar
Débuté par adrianoboller, 10 aoû. 2015 23:22 - 3 réponses
Connectez-vous…
adrianoboller
#1
Membre enregistré
3 655 messages
Popularité : +175 (223 votes)
Posté le 10 août 2015 - 23:22
//Exemplo
//CertificadoAssinatura is string = "66428db2ed4c2416d5861351ae2ceb1f"
MyCertificate is
Certificate
// Open the certificate picker of Windows
MyCertificate
=
CertificateSelect
(
)
// Cancelation or error
IF
MyCertificate
..
Name
=
""
THEN
RETURN
END
// Checks the validity of certificat for the signature
IF
MyCertificate
..
ValidForSignature
=
False
THEN
Info
(
"The selected certificate cannot be used to generate a signature."
)
RETURN
END
// Retrieve the buffer containing the signature
buf
Signature is Buffer
buf
Signature
=
CertificateSignString
(
"Character string to sign"
,
MyCertificate
)
// Retrieve the certificate found in the buffer of the signature
MyExtractedCertificate is
Certificate
MyExtractedCertificate
=
CertificateExtract
(
buf
Signature
)
// Manage the errors
IF
MyExtractedCertificate
=
Null
THEN
RETURN
END
// Open the window for certificate properties
CertificateOpenProperties
(
MyExtractedCertificate
)
//Interpretando o retorno
Certificado_Digital is
string
=
MyCertificate
..
Name
+
CRLF
+
MyCertificate
..
Issuer
+
CRLF
+
MyCertificate
..
SerialNumber
+
CRLF
+
MyCertificate
..
Reliability
+
CRLF
+
MyCertificate
..
ValidForSignature
SerialCertificadoDigital is
string
=
MyCertificate
..
SerialNumber
SerialCertificadoDigital
=
Replace
(
SerialCertificadoDigital
,
" "
,
""
)
DataValidadeCertificadoDigital is
string
=
DateToString
(
MyCertificate
..
StartValidityDate
,
"DD/MM/YYYY HH:MM:SS"
) +
" até "
+
DateToString
(
MyCertificate
..
EndValidityDate
,
"DD/MM/YYYY HH:MM:SS"
)
Hoje is DateTime
=
DateSys
(
) +
TimeSys
(
)
UltimoPrazoCertificado is DateTime
=
MyCertificate
..
EndValidityDate
IF
UltimoPrazoCertificado
<
Hoje
THEN
Info
(
"Certificado Vencido"
)
ELSE
n
Dias is
int
=
DateDifference
(
Middle
(
Hoje
,
1
,
8
)
,
Middle
(
UltimoPrazoCertificado
,
1
,
8
)
)
//info(nDias)
IF
n
Dias
<
30
THEN
Info
(
"Providenciar a atualização do certificado faltam: "
+
n
Dias
)
END
END
EDT_
Certificado
=
Certificado_Digital
EDT_
Serial
=
SerialCertificadoDigital
EDT_
Validade
=
DataValidadeCertificadoDigital
ok is
boolean
=
False
PathFile is
string
=
fCurrentDir
(
fCurrentDrive
(
)
) +
"\INFOSG.ini"
//Serial
ok
=
INIWrite
(
"INFOSG"
,
"CertificadoDigital"
,
SerialCertificadoDigital
,
PathFile
)
IF
ErrorOccurred
=
True
Error
(
)
END
//Data Validade
ok
=
INIWrite
(
"INFOSG"
,
"CertificadoDigitalValidade"
,
DataValidadeCertificadoDigital
,
PathFile
)
IF
ErrorOccurred
=
True
Error
(
)
END
Signaler
0
0
adrianoboller
#2
Membre enregistré
3 655 messages
Popularité : +175 (223 votes)
Posté le 10 août 2015 - 23:36
Isso é usado para pegar os dados dos Certificados Digitais A1, A2, A3
Signaler
0
0
ANGELOREIS
#3
Membre enregistré
44 messages
Popularité : +7 (7 votes)
Posté le 12 août 2015 - 16:12
Dá para fazer a assinatura de XML com esse tipo de variável 'certificate'?
--
Analista de Sistemas Jr
Assessor de Comunicação
Fotografo nas horas Vagas
Pai da Alícia e Marido da Andréa <3
Signaler
0
0
adrianoboller
#4
Membre enregistré
3 655 messages
Popularité : +175 (223 votes)
Posté le 18 août 2015 - 17:13
Estou estudando ainda nao tenho essa informação por completo...
Em breve posto mais detalhes sobre isso.
Signaler
0
0
→ Revenir à WINDEV 25
WINDEV 25
Français
English
Español
Portuguesa
Fermer cette fenêtre
Type de recherche
Uniquement les sujets
Tous les messages
Période de recherche
Date indifférente
Moins d'une heure
Moins de 24 heures
Moins d'une semaine
Moins d'un mois
Moins d'un an
Annuler
Aperçu de votre message
Ajouter une image
Importer une image depuis une URL
Envoyer une image depuis un fichier de votre disque
Déposez ici un fichier ou cliquez sur "Parcourir..."
ou
Annuler
0%
WLangage
SQL
XML, HTML
JAVA, Javascript
Texte