C# 클래스 GSF.Security.SecurityProviderUtility

A helper class containing methods used in the implementation of role-based security.
파일 보기 프로젝트 열기: GridProtectionAlliance/gsf 1 사용 예제들

공개 메소드들

메소드 설명
CreateProvider ( string username ) : ISecurityProvider

Creates a new ISecurityProvider based on the settings in the config file.

EncryptPassword ( string password ) : string

Encrypts the password to a one-way hash using the SHA1 hash algorithm.

GeneratePassword ( int length ) : string

Generates a random password of the specified length with at least one uppercase letter, one lowercase letter, one special character and one digit.

IsRegexMatch ( string spec, string target ) : bool

Determines if the specified target matches the specified spec.

IsResourceAccessible ( string resource ) : bool

Determines if the current user, as defined by the Thread.CurrentPrincipal, has permission to access the specified resource based on settings in the config file.

IsResourceSecurable ( string resource ) : bool

Determines if the specified resource is to be secured based on settings in the config file.

SendNotification ( string recipient, string subject, string body ) : void

Sends email notification message to the specified recipient using settings specified in the config file.

비공개 메소드들

메소드 설명
SecurityProviderUtility ( ) : System

메소드 상세

CreateProvider() 공개 정적인 메소드

Creates a new ISecurityProvider based on the settings in the config file.
public static CreateProvider ( string username ) : ISecurityProvider
username string Username of the user for whom the is to be created.
리턴 ISecurityProvider

EncryptPassword() 공개 정적인 메소드

Encrypts the password to a one-way hash using the SHA1 hash algorithm.
public static EncryptPassword ( string password ) : string
password string Password to be encrypted.
리턴 string

GeneratePassword() 공개 정적인 메소드

Generates a random password of the specified length with at least one uppercase letter, one lowercase letter, one special character and one digit.
A value of less than 8 is specified for the .
public static GeneratePassword ( int length ) : string
length int Length of the password to generate.
리턴 string

IsRegexMatch() 공개 정적인 메소드

Determines if the specified target matches the specified spec.
public static IsRegexMatch ( string spec, string target ) : bool
spec string Spec string that can include wildcards ('*'). For example, *.txt
target string Target string to be compared with the .
리턴 bool

IsResourceAccessible() 공개 정적인 메소드

Determines if the current user, as defined by the Thread.CurrentPrincipal, has permission to access the specified resource based on settings in the config file.
public static IsResourceAccessible ( string resource ) : bool
resource string Name of the resource to be checked.
리턴 bool

IsResourceSecurable() 공개 정적인 메소드

Determines if the specified resource is to be secured based on settings in the config file.
public static IsResourceSecurable ( string resource ) : bool
resource string Name of the resource to be checked.
리턴 bool

SendNotification() 공개 정적인 메소드

Sends email notification message to the specified recipient using settings specified in the config file.
public static SendNotification ( string recipient, string subject, string body ) : void
recipient string Email address of the notification recipient.
subject string Subject of the notification.
body string Content of the notification.
리턴 void